Chromium Code Reviews| 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..6f6e2c6a24a272ce2b13c3a6f087006d338e6ebe |
| --- /dev/null |
| +++ b/client/site_tests/power_LoadTest/extension/testparams.js |
| @@ -0,0 +1,37 @@ |
| +// Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
|
Sameer Nanda
2011/02/28 22:11:34
change year to 2011
Benson Leung
2011/03/01 02:16:19
Done.
|
| +// 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; |
|
Sameer Nanda
2011/02/28 22:11:34
> 80 columns
Benson Leung
2011/03/01 02:16:19
Done.
|
| + 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); |
| + } |
| +); |
| + |