OLD | NEW |
---|---|
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 cr.define('settings', function() { | 5 cr.define('test', function() { |
Dan Beam
2017/06/07 01:16:57
why test.Test?
dpapad
2017/06/07 01:19:10
As opposed to what? A different namespace? No name
Dan Beam
2017/06/07 01:33:50
arguably, this is "testing" code. as in: it's not
dpapad
2017/06/07 03:23:08
Done.
| |
6 /** | 6 /** |
7 * A base class for all test browser proxies to inherit from. Provides helper | 7 * A base class for all test browser proxies to inherit from. Provides helper |
8 * methods for allowing tests to track when a method was called. | 8 * methods for allowing tests to track when a method was called. |
9 * | 9 * |
10 * Subclasses are responsible for calling |methodCalled|, when a method is | 10 * Subclasses are responsible for calling |methodCalled|, when a method is |
11 * called, which will trigger callers of |whenCalled| to get notified. | 11 * called, which will trigger callers of |whenCalled| to get notified. |
12 * For example: | 12 * For example: |
13 * -------------------------------------------------------------------------- | 13 * -------------------------------------------------------------------------- |
14 * var MyTestBrowserProxy = function() { | 14 * var MyTestBrowserProxy = function() { |
15 * TestBrowserProxy.call(this, ['myMethod']); | 15 * TestBrowserProxy.call(this, ['myMethod']); |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
80 this.resolverMap_.forEach(function(value, methodName) { | 80 this.resolverMap_.forEach(function(value, methodName) { |
81 this.resolverMap_.set(methodName, new PromiseResolver()); | 81 this.resolverMap_.set(methodName, new PromiseResolver()); |
82 }.bind(this)); | 82 }.bind(this)); |
83 }, | 83 }, |
84 }; | 84 }; |
85 | 85 |
86 return { | 86 return { |
87 TestBrowserProxy: TestBrowserProxy, | 87 TestBrowserProxy: TestBrowserProxy, |
88 }; | 88 }; |
89 }); | 89 }); |
OLD | NEW |