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

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

Issue 2668623002: MD Settings: Fix remaining tests that fail in Vulcanized mode. (Closed)
Patch Set: Rebase Created 3 years, 10 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 Password Settings tests. */ 5 /** @fileoverview Runs the Polymer Password Settings 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 16 matching lines...) Expand all
27 /** @override */ 27 /** @override */
28 browsePreload: 28 browsePreload:
29 'chrome://md-settings/passwords_and_forms_page/passwords_section.html', 29 'chrome://md-settings/passwords_and_forms_page/passwords_section.html',
30 30
31 /** @override */ 31 /** @override */
32 extraLibraries: PolymerTest.getLibraries(ROOT_PATH), 32 extraLibraries: PolymerTest.getLibraries(ROOT_PATH),
33 33
34 /** @override */ 34 /** @override */
35 setUp: function() { 35 setUp: function() {
36 PolymerTest.prototype.setUp.call(this); 36 PolymerTest.prototype.setUp.call(this);
37 PolymerTest.clearBody();
37 38
38 // Test is run on an individual element that won't have a page language. 39 // Test is run on an individual element that won't have a page language.
39 this.accessibilityAuditConfig.auditRulesToIgnore.push('humanLangMissing'); 40 this.accessibilityAuditConfig.auditRulesToIgnore.push('humanLangMissing');
40 }, 41 },
41 42
42 /** 43 /**
43 * Helper method that validates a that elements in the password list match 44 * Helper method that validates a that elements in the password list match
44 * the expected data. 45 * the expected data.
45 * @param {!Element} listElement The iron-list element that will be checked. 46 * @param {!Element} listElement The iron-list element that will be checked.
46 * @param {!Array<!chrome.passwordsPrivate.PasswordUiEntry>} passwordList The 47 * @param {!Array<!chrome.passwordsPrivate.PasswordUiEntry>} passwordList The
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 Polymer.dom.flush(); 164 Polymer.dom.flush();
164 }, 165 },
165 }; 166 };
166 167
167 /** This test will validate that the section is loaded with data. */ 168 /** This test will validate that the section is loaded with data. */
168 TEST_F('SettingsPasswordSectionBrowserTest', 'uiTests', function() { 169 TEST_F('SettingsPasswordSectionBrowserTest', 'uiTests', function() {
169 var self = this; 170 var self = this;
170 171
171 suite('PasswordsSection', function() { 172 suite('PasswordsSection', function() {
172 test('verifyNoSavedPasswords', function() { 173 test('verifyNoSavedPasswords', function() {
173 assertEquals(self.browsePreload, document.location.href); 174 // TODO(dpapad): This assertion does not make sense in vulcanized mode.
175 //assertEquals(self.browsePreload, document.location.href);
Dan Beam 2017/02/03 22:49:08 remove it, maybe? is this because of the <base> t
174 176
175 var passwordsSection = self.createPasswordsSection_([], []); 177 var passwordsSection = self.createPasswordsSection_([], []);
176 178
177 self.validatePasswordList(passwordsSection.$.passwordList, []); 179 self.validatePasswordList(passwordsSection.$.passwordList, []);
178 180
179 assertFalse(passwordsSection.$.noPasswordsLabel.hidden); 181 assertFalse(passwordsSection.$.noPasswordsLabel.hidden);
180 assertTrue(passwordsSection.$.savedPasswordsHeading.hidden); 182 assertTrue(passwordsSection.$.savedPasswordsHeading.hidden);
181 }); 183 });
182 184
183 test('verifySavedPasswordLength', function() { 185 test('verifySavedPasswordLength', function() {
184 assertEquals(self.browsePreload, document.location.href); 186 // TODO(dpapad): This assertion does not make sense in vulcanized mode.
187 //assertEquals(self.browsePreload, document.location.href);
185 188
186 var passwordList = [ 189 var passwordList = [
187 FakeDataMaker.passwordEntry('site1.com', 'luigi', 1), 190 FakeDataMaker.passwordEntry('site1.com', 'luigi', 1),
188 FakeDataMaker.passwordEntry('longwebsite.com', 'peach', 7), 191 FakeDataMaker.passwordEntry('longwebsite.com', 'peach', 7),
189 FakeDataMaker.passwordEntry('site2.com', 'mario', 70), 192 FakeDataMaker.passwordEntry('site2.com', 'mario', 70),
190 FakeDataMaker.passwordEntry('site1.com', 'peach', 11), 193 FakeDataMaker.passwordEntry('site1.com', 'peach', 11),
191 FakeDataMaker.passwordEntry('google.com', 'mario', 7), 194 FakeDataMaker.passwordEntry('google.com', 'mario', 7),
192 FakeDataMaker.passwordEntry('site2.com', 'luigi', 8), 195 FakeDataMaker.passwordEntry('site2.com', 'luigi', 8),
193 ]; 196 ];
194 197
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
440 assertEquals(item.loginPair.username, event.detail.username); 443 assertEquals(item.loginPair.username, event.detail.username);
441 done(); 444 done();
442 }); 445 });
443 446
444 MockInteractions.tap(passwordDialog.$.showPasswordButton); 447 MockInteractions.tap(passwordDialog.$.showPasswordButton);
445 }); 448 });
446 }); 449 });
447 450
448 mocha.run(); 451 mocha.run();
449 }); 452 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698