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

Side by Side Diff: chrome/test/data/webui/mocha_adapter.js

Issue 1466433002: Add Settings bluetooth page test (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make Chrome OS only Created 4 years, 12 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 /** 5 /**
6 * @fileoverview A mocha adapter for BrowserTests. To use, include mocha.js and 6 * @fileoverview A mocha adapter for BrowserTests. To use, include mocha.js and
7 * mocha_adapter.js in a WebUIBrowserTest's extraLibraries array. 7 * mocha_adapter.js in a WebUIBrowserTest's extraLibraries array.
8 */ 8 */
9 9
10 // NOTE: When defining TEST_F() functions that use Mocha, use 'var self = this'
11 // for referencing the Test object within suite() and test() function objects
12 // (instead of binding |this|), since |this| within those objects will reference
13 // the Mocha Suite or Test instance.
Dan Beam 2015/12/28 20:01:39 this is probably more a general understanding of |
michaelpg 2015/12/28 20:39:35 Yes, the test cases are call'd or apply'd on a par
stevenjb 2015/12/28 20:49:16 There has been some confusion and discussion about
14
10 /** 15 /**
11 * Initializes a mocha reporter for the BrowserTest framework, which registers 16 * Initializes a mocha reporter for the BrowserTest framework, which registers
12 * event listeners on the given Runner. 17 * event listeners on the given Runner.
13 * @constructor 18 * @constructor
14 * @param {Runner} runner Runs the tests and provides hooks for test results 19 * @param {Runner} runner Runs the tests and provides hooks for test results
15 * (see Runner.prototype in mocha.js). 20 * (see Runner.prototype in mocha.js).
16 */ 21 */
17 function BrowserTestReporter(runner) { 22 function BrowserTestReporter(runner) {
18 var passes = 0; 23 var passes = 0;
19 var failures = 0; 24 var failures = 0;
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 mocha.setup({ 62 mocha.setup({
58 // Use TDD interface instead of BDD. 63 // Use TDD interface instead of BDD.
59 ui: 'tdd', 64 ui: 'tdd',
60 // Use custom reporter to interface with BrowserTests. 65 // Use custom reporter to interface with BrowserTests.
61 reporter: BrowserTestReporter, 66 reporter: BrowserTestReporter,
62 // Mocha timeouts are set to 2 seconds initially. This isn't nearly enough for 67 // Mocha timeouts are set to 2 seconds initially. This isn't nearly enough for
63 // slower bots (e.g., Dr. Memory). Disable timeouts globally, because the C++ 68 // slower bots (e.g., Dr. Memory). Disable timeouts globally, because the C++
64 // will handle it (and has scaled timeouts for slower bots). 69 // will handle it (and has scaled timeouts for slower bots).
65 enableTimeouts: false, 70 enableTimeouts: false,
66 }); 71 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698