OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 * TestFixture for testing messages of dictionary download progress in language | 6 * TestFixture for testing messages of dictionary download progress in language |
7 * options WebUI. | 7 * options WebUI. |
8 * @extends {testing.Test} | 8 * @extends {testing.Test} |
9 * @constructor | 9 * @constructor |
10 **/ | 10 */ |
11 function LanguagesOptionsDictionaryDownloadWebUITest() {} | 11 function LanguagesOptionsDictionaryDownloadWebUITest() {} |
12 | 12 |
13 LanguagesOptionsDictionaryDownloadWebUITest.prototype = { | 13 LanguagesOptionsDictionaryDownloadWebUITest.prototype = { |
14 __proto__: testing.Test.prototype, | 14 __proto__: testing.Test.prototype, |
15 | 15 |
16 /** | 16 /** |
17 * Browse to languages options. | 17 * Browse to languages options. |
18 **/ | 18 */ |
19 browsePreload: 'chrome://settings-frame/languages', | 19 browsePreload: 'chrome://settings-frame/languages', |
20 | 20 |
21 /** | 21 /** |
22 * Register a mock dictionary handler. | 22 * Register a mock dictionary handler. |
23 */ | 23 */ |
24 preLoad: function() { | 24 preLoad: function() { |
25 this.makeAndRegisterMockHandler(['retryDictionaryDownload']); | 25 this.makeAndRegisterMockHandler(['retryDictionaryDownload']); |
26 this.mockHandler.stubs().retryDictionaryDownload(). | 26 this.mockHandler.stubs().retryDictionaryDownload(). |
27 will(callFunction(function() { | 27 will(callFunction(function() { |
28 options.LanguageOptions.onDictionaryDownloadBegin('en-US'); | 28 options.LanguageOptions.onDictionaryDownloadBegin('en-US'); |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 TEST_F('LanguagesOptionsDictionaryDownloadWebUITest', | 92 TEST_F('LanguagesOptionsDictionaryDownloadWebUITest', |
93 'testdictionaryDownloadRetry', | 93 'testdictionaryDownloadRetry', |
94 function() { | 94 function() { |
95 this.mockHandler.expects(once()).retryDictionaryDownload(). | 95 this.mockHandler.expects(once()).retryDictionaryDownload(). |
96 will(callFunction(function() { | 96 will(callFunction(function() { |
97 options.LanguageOptions.onDictionaryDownloadBegin('en-US'); | 97 options.LanguageOptions.onDictionaryDownloadBegin('en-US'); |
98 })); | 98 })); |
99 options.LanguageOptions.onDictionaryDownloadFailure('en-US'); | 99 options.LanguageOptions.onDictionaryDownloadFailure('en-US'); |
100 $('dictionary-download-retry-button').click(); | 100 $('dictionary-download-retry-button').click(); |
101 }); | 101 }); |
OLD | NEW |