OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium 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 // Include test fixture. | 5 // Include test fixture. |
6 GEN_INCLUDE(['chromevox_e2e_test_base.js']); | 6 GEN_INCLUDE(['chromevox_e2e_test_base.js']); |
7 | 7 |
8 /** | 8 /** |
9 * Base test fixture for ChromeVox Next end to end tests. | 9 * Base test fixture for ChromeVox Next end to end tests. |
10 * | 10 * |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 return; | 59 return; |
60 | 60 |
61 r.removeEventListener('focus', listener, true); | 61 r.removeEventListener('focus', listener, true); |
62 r.removeEventListener('loadComplete', listener, true); | 62 r.removeEventListener('loadComplete', listener, true); |
63 CommandHandler.onCommand('nextObject'); | 63 CommandHandler.onCommand('nextObject'); |
64 callback && callback(evt.target); | 64 callback && callback(evt.target); |
65 callback = null; | 65 callback = null; |
66 }; | 66 }; |
67 r.addEventListener('focus', listener, true); | 67 r.addEventListener('focus', listener, true); |
68 r.addEventListener('loadComplete', listener, true); | 68 r.addEventListener('loadComplete', listener, true); |
69 var createParams = { | 69 var createParams = {active: true, url: url}; |
70 active: true, | |
71 url: url | |
72 }; | |
73 chrome.tabs.create(createParams); | 70 chrome.tabs.create(createParams); |
74 }.bind(this)); | 71 }.bind(this)); |
75 }, | 72 }, |
76 | 73 |
77 listenOnce: function(node, eventType, callback, capture) { | 74 listenOnce: function(node, eventType, callback, capture) { |
78 var innerCallback = this.newCallback(function() { | 75 var innerCallback = this.newCallback(function() { |
79 node.removeEventListener(eventType, innerCallback, capture); | 76 node.removeEventListener(eventType, innerCallback, capture); |
80 callback.apply(this, arguments); | 77 callback.apply(this, arguments); |
81 }); | 78 }); |
82 node.addEventListener(eventType, innerCallback, capture); | 79 node.addEventListener(eventType, innerCallback, capture); |
83 }, | 80 }, |
84 | 81 |
85 /** | 82 /** |
86 * Forces output to place context utterances at the end of output. This eases | 83 * Forces output to place context utterances at the end of output. This eases |
87 * rebaselining when changing context ordering for a specific role. | 84 * rebaselining when changing context ordering for a specific role. |
88 */ | 85 */ |
89 forceContextualLastOutput: function() { | 86 forceContextualLastOutput: function() { |
90 for (var role in Output.ROLE_INFO_) | 87 for (var role in Output.ROLE_INFO_) |
91 Output.ROLE_INFO_[role]['outputContextFirst'] = undefined; | 88 Output.ROLE_INFO_[role]['outputContextFirst'] = undefined; |
92 } | 89 } |
93 }; | 90 }; |
OLD | NEW |