| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium OS Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // External Test Parameters Content Script! | 5 // External Test Parameters Content Script! |
| 6 | 6 |
| 7 // initial values. | 7 // initial values. |
| 8 var test_time_ms = 0; | 8 var test_time_ms = 0; |
| 9 var should_scroll = false; | 9 var should_scroll = false; |
| 10 var should_scroll_up = false; | 10 var should_scroll_up = false; |
| 11 var scroll_loop = false; | 11 var scroll_loop = false; |
| 12 var scroll_interval_ms = 0; | 12 var scroll_interval_ms = 0; |
| 13 var scroll_by_pixels = 0; | 13 var scroll_by_pixels = 0; |
| 14 var tasks = ""; |
| 14 | 15 |
| 15 document.getElementById('myCustomEventDiv').addEventListener('myCustomEvent', | 16 document.getElementById('myCustomEventDiv').addEventListener('myCustomEvent', |
| 16 function() { | 17 function() { |
| 17 // pull our test parameters from divs on this page. | 18 // pull our test parameters from divs on this page. |
| 18 var eventData = document.getElementById('myCustomEventDiv').innerText; | 19 var eventData = document.getElementById('myCustomEventDiv').innerText; |
| 19 test_time_ms = document.getElementById('test_time_ms').innerText; | 20 test_time_ms = document.getElementById('test_time_ms').innerText; |
| 20 should_scroll = document.getElementById('should_scroll').innerText; | 21 should_scroll = document.getElementById('should_scroll').innerText; |
| 21 should_scroll_up = document.getElementById('should_scroll_up').innerText; | 22 should_scroll_up = document.getElementById('should_scroll_up').innerText; |
| 22 scroll_loop = document.getElementById('scroll_loop').innerText; | 23 scroll_loop = document.getElementById('scroll_loop').innerText; |
| 23 scroll_interval_ms = document.getElementById('scroll_interval_ms').innerText
; | 24 scroll_interval_ms = document.getElementById('scroll_interval_ms').innerText
; |
| 24 scroll_by_pixels = document.getElementById('scroll_by_pixels').innerText; | 25 scroll_by_pixels = document.getElementById('scroll_by_pixels').innerText; |
| 26 tasks = document.getElementById('tasks').innerText; |
| 25 | 27 |
| 26 // pass to background page via sendRequest. | 28 // pass to background page via sendRequest. |
| 27 var request = { _test_time_ms : test_time_ms, | 29 var request = { _test_time_ms : test_time_ms, |
| 28 _should_scroll : should_scroll, | 30 _should_scroll : should_scroll, |
| 29 _should_scroll_up : should_scroll_up, | 31 _should_scroll_up : should_scroll_up, |
| 30 _scroll_loop : scroll_loop, | 32 _scroll_loop : scroll_loop, |
| 31 _scroll_interval_ms : scroll_interval_ms, | 33 _scroll_interval_ms : scroll_interval_ms, |
| 32 _scroll_by_pixels : scroll_by_pixels | 34 _scroll_by_pixels : scroll_by_pixels, |
| 35 _tasks : tasks |
| 33 } | 36 } |
| 34 chrome.extension.sendRequest(request); | 37 chrome.extension.sendRequest(request); |
| 35 } | 38 } |
| 36 ); | 39 ); |
| 37 | 40 |
| OLD | NEW |