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

Side by Side Diff: chrome/browser/ui/webui/options/edit_dictionary_browsertest.js

Issue 11308076: Browser-tests for editing the dictionary on chrome://settings/editDictionary (Closed) Base URL: http://git.chromium.org/chromium/src.git@dictionary
Patch Set: Created 8 years, 1 month 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
(Empty)
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
3 // found in the LICENSE file.
4
5 /**
6 * TestFixture for EditDictionaryOverlay WebUI testing.
7 * @extends {testing.Test}
8 * @constructor
9 **/
10 function EditDictionaryWebUITest() {}
11
12 EditDictionaryWebUITest.prototype = {
13 __proto__: testing.Test.prototype,
14
15 /**
16 * Browse to the edit dictionary page & call our preLoad().
17 */
18 browsePreload: 'chrome://settings-frame/editDictionary',
19
20 /**
21 * Register a mock dictionary handler.
22 */
23 preLoad: function() {
24 this.makeAndRegisterMockHandler(
25 ['refreshDictionaryWords',
26 'addDictionaryWord',
27 'removeDictionaryWord',
28 ]);
29 this.mockHandler.stubs().refreshDictionaryWords().
30 will(callFunction(function() {
31 EditDictionaryOverlay.setWordList([]);
32 }));
33 this.mockHandler.stubs().addDictionaryWord(ANYTHING);
34 this.mockHandler.stubs().removeDictionaryWord(ANYTHING);
35 },
36 };
37
38 TEST_F('EditDictionaryWebUITest', 'testAddRemoveWords', function() {
39 var testWord = 'foo';
40 $('language-dictionary-overlay-page').querySelector('input').value = testWord;
41
42 this.mockHandler.expects(once()).addDictionaryWord([testWord]).
43 will(callFunction(function() {
44 EditDictionaryOverlay.setWordList([testWord]);
45 }));
46 EditDictionaryOverlay.getInstance().wordList_.items[0].onEditCommitted_(null);
47
48 this.mockHandler.expects(once()).removeDictionaryWord([String(0)]).
49 will(callFunction(function() {
50 EditDictionaryOverlay.setWordList([]);
51 }));
52 EditDictionaryOverlay.getInstance().wordList_.deleteItemAtIndex(0);
53 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/options/language_dictionary_overlay.js ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698