Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Unified Diff: client/site_tests/power_LoadTest/extension/background.html

Issue 6691048: power_LoadTest: custom tasks param allows for parallel tasks (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/autotest.git
Patch Set: Rebased Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « client/site_tests/power_LoadTest/extension.crx ('k') | client/site_tests/power_LoadTest/power_LoadTest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/site_tests/power_LoadTest/extension/background.html
diff --git a/client/site_tests/power_LoadTest/extension/background.html b/client/site_tests/power_LoadTest/extension/background.html
index 9a89b40b660a690efea39c07a504961fc338db67..92aa98feaaab0268b6bd1b05b30338d39df8dacb 100755
--- a/client/site_tests/power_LoadTest/extension/background.html
+++ b/client/site_tests/power_LoadTest/extension/background.html
@@ -70,32 +70,42 @@ function parseTaskList(tasks_string) {
// Parse each task.
for (var i in task_strings) {
- // Extract task parameters.
- var params = task_strings[i].split(';');
- var cmd = params[0];
- var urls = params[1].split(',');
- var duration = seconds(parseInt(params[2]));
- if (params.length > 3)
- var delay = seconds(parseInt(params[3]));
-
- if (cmd == 'window') {
- task_list.push( { type: 'window',
- start: time,
- duration: duration,
- focus: true,
- tabs: urls } );
- }
- else if (cmd == 'cycle') {
- task_list.push( { type: 'cycle',
- start: time,
- duration: duration,
- delay: delay,
- timeout: seconds(10),
- focus: true,
- urls: urls } );
+ var task_strings_parallel = task_strings[i].split('&');
+ var max_duration = 0;
+
+ for (var j in task_strings_parallel) {
+ // Extract task parameters.
+ var params = task_strings_parallel[j].split(';');
+ var cmd = params[0];
+ var urls = params[1].split(',');
+ var duration = seconds(parseInt(params[2]));
+ if (duration > max_duration)
+ max_duration = duration;
+ if (params.length > 3)
+ var delay = seconds(parseInt(params[3]));
+
+ if (cmd == 'window') {
+ task_list.push( { type: 'window',
+ start: time,
+ duration: duration,
+ focus: true,
+ tabs: urls } );
+ }
+ else if (cmd == 'cycle') {
+ task_list.push( { type: 'cycle',
+ start: time,
+ duration: duration,
+ delay: delay,
+ timeout: seconds(10),
+ focus: true,
+ urls: urls } );
+ }
+ else {
+ console.log('Unrecognized command: ' + cmd);
+ }
}
// Increment the time to determine the start time of the next task.
- time += duration;
+ time += max_duration;
}
return task_list;
}
« no previous file with comments | « client/site_tests/power_LoadTest/extension.crx ('k') | client/site_tests/power_LoadTest/power_LoadTest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698