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

Unified Diff: client/site_tests/power_LoadTest/extension/testparams.js

Issue 2844047: Modify power_LoadTest Extension to pull in test parameters. (Closed) Base URL: ssh://gitrw.chromium.org/autotest.git
Patch Set: Address review feedback. Created 9 years, 10 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
Index: client/site_tests/power_LoadTest/extension/testparams.js
diff --git a/client/site_tests/power_LoadTest/extension/testparams.js b/client/site_tests/power_LoadTest/extension/testparams.js
new file mode 100644
index 0000000000000000000000000000000000000000..61fa4b5642af800e20802baac65233bd197ffb54
--- /dev/null
+++ b/client/site_tests/power_LoadTest/extension/testparams.js
@@ -0,0 +1,38 @@
+// Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// External Test Parameters Content Script!
+
+// initial values.
+var test_time_ms = 0;
+var should_scroll = false;
+var should_scroll_up = false;
+var scroll_loop = false;
+var scroll_interval_ms = 0;
+var scroll_by_pixels = 0;
+
+document.getElementById('myCustomEventDiv').addEventListener('myCustomEvent',
+ function() {
+ // pull our test parameters from divs on this page.
+ var eventData = document.getElementById('myCustomEventDiv').innerText;
+ test_time_ms = document.getElementById('test_time_ms').innerText;
+ should_scroll = document.getElementById('should_scroll').innerText;
+ should_scroll_up = document.getElementById('should_scroll_up').innerText;
+ scroll_loop = document.getElementById('scroll_loop').innerText;
+ scroll_interval_ms = \
+ document.getElementById('scroll_interval_ms').innerText;
+ scroll_by_pixels = document.getElementById('scroll_by_pixels').innerText;
+
+ // pass to background page via sendRequest.
+ var request = { _test_time_ms : test_time_ms,
+ _should_scroll : should_scroll,
+ _should_scroll_up : should_scroll_up,
+ _scroll_loop : scroll_loop,
+ _scroll_interval_ms : scroll_interval_ms,
+ _scroll_by_pixels : scroll_by_pixels
+ }
+ chrome.extension.sendRequest(request);
+ }
+);
+

Powered by Google App Engine
This is Rietveld 408576698