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
3 // found in the LICENSE file.
5 // Include test fixture.
6 GEN_INCLUDE(['chromevox_e2e_test_base.js']);
9 * Base test fixture for ChromeVox Next end to end tests.
11 * These tests are identical to ChromeVoxE2ETests except for performing the
12 * necessary setup to run ChromeVox Next.
14 * @extends {ChromeVoxE2ETest}
16 function ChromeVoxNextE2ETest() {
17 ChromeVoxE2ETest.call(this);
20 ChromeVoxNextE2ETest.prototype = {
21 __proto__: ChromeVoxE2ETest.prototype,
24 * Launches a new tab with the given document, and runs callback when a load
26 * @param {function() : void} doc Snippet wrapped inside of a function.
27 * @param {function()} opt_callback Called once the document is ready.
29 runWithLoadedTree: function(doc, callback) {
30 callback = this.newCallback(callback);
31 chrome.automation.getDesktop(function(r) {
32 var listener = function(evt) {
33 if (!evt.target.docUrl ||
34 evt.target.docUrl.indexOf('test') == -1)
37 r.removeEventListener(listener);
38 callback && callback(evt.target);
41 r.addEventListener('loadComplete', listener, true);