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

Side by Side Diff: chrome/test/data/webui/settings/search_page_test.js

Issue 2522773002: MD Settings: extension-controlled indicators for default search engine (Closed)
Patch Set: test Created 4 years 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
« no previous file with comments | « chrome/browser/resources/settings/search_page/search_page.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_search_page', function() { 5 cr.define('settings_search_page', function() {
6 function generateSearchEngineInfo() { 6 function generateSearchEngineInfo() {
7 var searchEngines0 = settings_search.createSampleSearchEngine( 7 var searchEngines0 = settings_search.createSampleSearchEngine(
8 true, false, false); 8 true, false, false);
9 searchEngines0.default = true; 9 searchEngines0.default = true;
10 var searchEngines1 = settings_search.createSampleSearchEngine( 10 var searchEngines1 = settings_search.createSampleSearchEngine(
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 Polymer.dom.flush(); 66 Polymer.dom.flush();
67 assertEquals(2, selectElement.selectedIndex); 67 assertEquals(2, selectElement.selectedIndex);
68 68
69 browserProxy.whenCalled('setDefaultSearchEngine').then(function() { 69 browserProxy.whenCalled('setDefaultSearchEngine').then(function() {
70 // Since the change happened in a different tab, there should be no 70 // Since the change happened in a different tab, there should be no
71 // new call to |setDefaultSearchEngine|. 71 // new call to |setDefaultSearchEngine|.
72 assertNotReached('Should not call setDefaultSearchEngine again'); 72 assertNotReached('Should not call setDefaultSearchEngine again');
73 }); 73 });
74 }); 74 });
75 }); 75 });
76
77 test('ControlledByExtension', function() {
78 return browserProxy.whenCalled('getSearchEnginesList').then(function() {
79 var selectElement = page.$$('select');
80 assertFalse(selectElement.disabled);
81 assertFalse(!!page.$$('extension-controlled-indicator'));
82
83 page.prefs = {
84 default_search_provider: {
85 enabled: {
86 controlledBy: chrome.settingsPrivate.ControlledBy.EXTENSION,
87 controlledByName: 'fake extension name',
88 enforcement: chrome.settingsPrivate.Enforcement.ENFORCED,
89 extensionId: 'fake extension id',
90 extensionCanBeDisabled: true,
91 value: true,
92 },
93 },
94 };
95 Polymer.dom.flush();
96
97 assertTrue(selectElement.disabled);
98 assertTrue(!!page.$$('extension-controlled-indicator'));
99 });
100 });
76 }); 101 });
77 } 102 }
78 103
79 return { 104 return {
80 registerTests: registerTests, 105 registerTests: registerTests,
81 }; 106 };
82 }); 107 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/settings/search_page/search_page.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698