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

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

Issue 2754873003: MD Settings: always let users get to autofill/passwords page (Closed)
Patch Set: Created 3 years, 9 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 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 /** @fileoverview Runs the Polymer Passwords and Forms tests. */ 5 /** @fileoverview Runs the Polymer Passwords and Forms tests. */
6 6
7 /** @const {string} Path to root from chrome/test/data/webui/settings/. */ 7 /** @const {string} Path to root from chrome/test/data/webui/settings/. */
8 var ROOT_PATH = '../../../../../'; 8 var ROOT_PATH = '../../../../../';
9 9
10 // Polymer BrowserTest fixture. 10 // Polymer BrowserTest fixture.
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 246
247 // The callback is coming from the manager, so the element shouldn't 247 // The callback is coming from the manager, so the element shouldn't
248 // have additional calls to the manager after the base expectations. 248 // have additional calls to the manager after the base expectations.
249 passwordManager.assertExpectations(basePasswordExpectations()); 249 passwordManager.assertExpectations(basePasswordExpectations());
250 autofillManager.assertExpectations(baseAutofillExpectations()); 250 autofillManager.assertExpectations(baseAutofillExpectations());
251 251
252 destroyPrefs(prefs); 252 destroyPrefs(prefs);
253 }); 253 });
254 }); 254 });
255 255
256 test('testActionabilityNope', function() {
257 return createPrefs(false, false).then(function(prefs) {
258
259 var element = createPasswordsAndFormsElement(prefs);
260
261 assertFalse(element.$.autofillManagerButton.hasAttribute('actionable'));
262 assertFalse(element.$.passwordManagerButton.hasAttribute('actionable'));
263
264 destroyPrefs(prefs);
265 });
266 });
267
268 test('testActionabilityYes', function() {
269 return createPrefs(true, true).then(function(prefs) {
270 var element = createPasswordsAndFormsElement(prefs);
271
272 assertTrue(element.$.autofillManagerButton.hasAttribute('actionable'));
273 assertTrue(element.$.passwordManagerButton.hasAttribute('actionable'));
274
275 destroyPrefs(prefs);
276 });
277 });
278
279 test('testAutofillExtensionIndicator', function() { 256 test('testAutofillExtensionIndicator', function() {
280 return createPrefs(true, true).then(function(prefs) { 257 return createPrefs(true, true).then(function(prefs) {
281 var element = createPasswordsAndFormsElement(prefs); 258 var element = createPasswordsAndFormsElement(prefs);
282 259
283 assertFalse(!!element.$$('#autofillExtensionIndicator')); 260 assertFalse(!!element.$$('#autofillExtensionIndicator'));
284 element.set('prefs.autofill.enabled.extensionId', 'test-id'); 261 element.set('prefs.autofill.enabled.extensionId', 'test-id');
285 Polymer.dom.flush(); 262 Polymer.dom.flush();
286 263
287 assertTrue(!!element.$$('#autofillExtensionIndicator')); 264 assertTrue(!!element.$$('#autofillExtensionIndicator'));
288 destroyPrefs(prefs); 265 destroyPrefs(prefs);
289 }); 266 });
290 }); 267 });
291 268
292 test('testPasswordsExtensionIndicator', function() { 269 test('testPasswordsExtensionIndicator', function() {
293 return createPrefs(true, true).then(function(prefs) { 270 return createPrefs(true, true).then(function(prefs) {
294 var element = createPasswordsAndFormsElement(prefs); 271 var element = createPasswordsAndFormsElement(prefs);
295 272
296 assertFalse(!!element.$$('#passwordsExtensionIndicator')); 273 assertFalse(!!element.$$('#passwordsExtensionIndicator'));
297 element.set('prefs.credentials_enable_service.extensionId', 'test-id'); 274 element.set('prefs.credentials_enable_service.extensionId', 'test-id');
298 Polymer.dom.flush(); 275 Polymer.dom.flush();
299 276
300 assertTrue(!!element.$$('#passwordsExtensionIndicator')); 277 assertTrue(!!element.$$('#passwordsExtensionIndicator'));
301 destroyPrefs(prefs); 278 destroyPrefs(prefs);
302 }); 279 });
303 }); 280 });
304 }); 281 });
305 282
306 mocha.run(); 283 mocha.run();
307 }); 284 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698