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(['chrome/browser/resources/chromeos/chromevox/testing/' +
7 'chromevox_e2e_test_base.js']);
10 * Base test fixture for ChromeVox Next end to end tests.
12 * These tests are identical to ChromeVoxE2ETests except for performing the
13 * necessary setup to run ChromeVox Next.
15 * @extends {ChromeVoxE2ETest}
17 function ChromeVoxNextE2ETest() {
18 ChromeVoxE2ETest.call(this);
21 ChromeVoxNextE2ETest.prototype = {
22 __proto__: ChromeVoxE2ETest.prototype,
25 * Launches a new tab with the given document, and runs callback when a load
27 * @param {function() : void} doc Snippet wrapped inside of a function.
28 * @param {function()} opt_callback Called once the document is ready.
30 runWithLoadedTree: function(doc, callback) {
31 callback = this.newCallback(callback);
32 chrome.automation.getDesktop(function(r) {
33 var listener = function(evt) {
34 if (!evt.target.attributes.url ||
35 evt.target.attributes.url.indexOf('test') == -1)
38 r.removeEventListener(listener);
39 callback && callback(evt.target);
42 r.addEventListener('loadComplete', listener, true);