From 984216b04c247f4c8bfe7d32bd370b91dd2e1439 Mon Sep 17 00:00:00 2001 From: Nimika Keshri Date: Thu, 30 Jun 2011 14:47:38 +0300 Subject: [PATCH] Changes: Performance test modified. Tracking pixel co-ordinates changed. RevBy: TrustMe --- .../harmattan/testscripts/get-coordinates.rb | 2 +- tests/harmattan/testscripts/test-perf.rb | 23 +++++++++++++++---- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/tests/harmattan/testscripts/get-coordinates.rb b/tests/harmattan/testscripts/get-coordinates.rb index 37a364e..aa1d6af 100755 --- a/tests/harmattan/testscripts/get-coordinates.rb +++ b/tests/harmattan/testscripts/get-coordinates.rb @@ -136,7 +136,7 @@ if @meegoHome.test_object_exists?(:text => appName) icon = @meegoHome.SwipeLauncherButton(:text => appName) while icon.attribute('visibleOnScreen') == 'false' || icon.attribute('y').to_i > 400 - @meegoHome.SwipePannableViewport( :name => 'SwipePage' ).MWidget( :name => 'glass' ).gesture(:Up, 1, 300) + @meegoHome.SwipePannableViewport( :name => 'SwipePage' ).MWidget( :name => 'glass' ).gesture(:Up, 1, 350) sleep(0.2) icon.refresh end diff --git a/tests/harmattan/testscripts/test-perf.rb b/tests/harmattan/testscripts/test-perf.rb index ea52405..967e8aa 100755 --- a/tests/harmattan/testscripts/test-perf.rb +++ b/tests/harmattan/testscripts/test-perf.rb @@ -219,7 +219,7 @@ class TC_PerformanceTests < Test::Unit::TestCase print_debug("Check the avarage system load is under 0.3") system "/usr/bin/waitloadavg.rb -l 0.3 -p 1.0 -t 100 -d" - start_command ="`#{PIXELCHANGED_BINARY} -t 20x20 -t 840x466 -q >> #{PIXELCHANGED_LOG} &`; #{FALA_GETTIME_BINARY} \"Started from command line\" >> #{PIXELCHANGED_LOG}; #{@options[:command]} &" + start_command ="`#{PIXELCHANGED_BINARY} -t 101x4 -t 845x473 -q >> #{PIXELCHANGED_LOG} &`; #{FALA_GETTIME_BINARY} \"Started from command line\" >> #{PIXELCHANGED_LOG}; #{@options[:command]} &" print_debug ("start command: #{start_command}") system start_command @@ -228,16 +228,29 @@ class TC_PerformanceTests < Test::Unit::TestCase @pos = `#{GET_COORDINATES_SCRIPT} -a #{@options[:application]}` @pos = @pos.split("\n")[-1] print_debug ("Co-ordinates: #{@pos}") - + x_val = Integer(@pos.split("x")[0]) + y_val = Integer(@pos.split("x")[1]) + print_debug("Check the avarage system load is under 0.3") system "/usr/bin/waitloadavg.rb -l 0.3 -p 1.0 -t 50 -d" + cmd = 0 + if (x_val >= 0 && x_val <= 420) + if (y_val >= 240 && y_val <= 480) + cmd = "#{PIXELCHANGED_BINARY} -c #{@pos} -t 101x4 -t 845x473 -f #{PIXELCHANGED_LOG} -q" + elsif (y_val >= 0 && y_val <= 239) + cmd = "#{PIXELCHANGED_BINARY} -c #{@pos} -t 101x473 -t 845x4 -f #{PIXELCHANGED_LOG} -q" + end + elsif (x_val >= 421 && x_val <= 900) + if (y_val >= 240 && y_val <= 480) + cmd = "#{PIXELCHANGED_BINARY} -c #{@pos} -t 101x473 -t 845x4 -f #{PIXELCHANGED_LOG} -q" + elsif (y_val >= 0 && y_val <= 239) + cmd = "#{PIXELCHANGED_BINARY} -c #{@pos} -t 101x4 -t 845x473 -f #{PIXELCHANGED_LOG} -q" + end + end - cmd = "#{PIXELCHANGED_BINARY} -c #{@pos} -t 20x20 -t 840x466 -f #{PIXELCHANGED_LOG} -q" print_debug("pixel changed command is : #{cmd}") system cmd - sleep (4) - # Raise meegotouchhome to the top. #Workaround for keeping the window stack in shape. print_debug("#{GET_COORDINATES_SCRIPT} -g")