Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(537)

Side by Side Diff: chrome/browser/resources/chromeos/chromevox/testing/chromevox_unittest_base.js

Issue 292313004: Port aria_util_test.js to run as a WebUI test. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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.
4
5 /**
6 * Shortcut for document.getElementById.
7 * @param {string} id of the element.
8 * @return {HTMLElement} with the id.
9 */
10 function $(id) {
11 return document.getElementById(id);
12 }
13
14 /**
15 * Base test fixture for ChromeVox unit tests.
16 *
17 * Note that while conceptually these are unit tests, these tests need
18 * to run in a full web page, so they're actually run as WebUI browser
19 * tests.
20 *
21 * @constructor
22 * @extends {testing.Test}
23 */
24 function ChromeVoxUnitTestBase() {}
25
26 ChromeVoxUnitTestBase.prototype = {
27 __proto__: testing.Test.prototype,
28
29 /** @override */
30 browsePreload: DUMMY_URL,
31
32 /**
33 * Loads some inlined html into the current document, replacing
34 * whatever was there previously. To use it, call it with the html
35 * inside an inline comment, like this:
36 *
37 * this.loadDoc(function() {/*!
38 * <p>Html goes here</p>
39 * * /});
40 */
41 loadDoc: function(commentEncodedHtml) {
42 var html = commentEncodedHtml.toString().
43 replace(/^[^\/]+\/\*!?/, '').
44 replace(/\*\/[^\/]+$/, '');
45 document.open();
46 document.write(html);
47 document.close();
48 }
49 };
OLDNEW
« no previous file with comments | « chrome/browser/resources/chromeos/chromevox/common/aria_util_test.js ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698