OLD | NEW |
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 Autofill Settings tests. */ | 5 /** @fileoverview Runs the Polymer Autofill 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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 */ | 163 */ |
164 createCreditCardDialog_: function(creditCardItem) { | 164 createCreditCardDialog_: function(creditCardItem) { |
165 var section = document.createElement('settings-credit-card-edit-dialog'); | 165 var section = document.createElement('settings-credit-card-edit-dialog'); |
166 section.creditCard = creditCardItem; | 166 section.creditCard = creditCardItem; |
167 document.body.appendChild(section); | 167 document.body.appendChild(section); |
168 Polymer.dom.flush(); | 168 Polymer.dom.flush(); |
169 return section; | 169 return section; |
170 }, | 170 }, |
171 }; | 171 }; |
172 | 172 |
173 // Disabled because of flakiness http://crbug.com/694289 | 173 TEST_F('SettingsAutofillSectionBrowserTest', 'CreditCardTests', function() { |
174 TEST_F('SettingsAutofillSectionBrowserTest', | |
175 'DISABLED_CreditCardTests', | |
176 function() { | |
177 var self = this; | 174 var self = this; |
178 | 175 |
179 setup(function() { | 176 setup(function() { |
180 PolymerTest.clearBody(); | 177 PolymerTest.clearBody(); |
181 }); | 178 }); |
182 | 179 |
183 suite('AutofillSection', function() { | 180 suite('AutofillSection', function() { |
184 test('verifyCreditCardCount', function() { | 181 test('verifyCreditCardCount', function() { |
185 var section = self.createAutofillSection_([], []); | 182 var section = self.createAutofillSection_([], []); |
186 assertTrue(!!section); | 183 assertTrue(!!section); |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 | 254 |
258 test('verifyAddVsEditCreditCardTitle', function() { | 255 test('verifyAddVsEditCreditCardTitle', function() { |
259 var newCreditCard = FakeDataMaker.emptyCreditCardEntry(); | 256 var newCreditCard = FakeDataMaker.emptyCreditCardEntry(); |
260 var newCreditCardDialog = self.createCreditCardDialog_(newCreditCard); | 257 var newCreditCardDialog = self.createCreditCardDialog_(newCreditCard); |
261 var oldCreditCard = FakeDataMaker.creditCardEntry(); | 258 var oldCreditCard = FakeDataMaker.creditCardEntry(); |
262 var oldCreditCardDialog = self.createCreditCardDialog_(oldCreditCard); | 259 var oldCreditCardDialog = self.createCreditCardDialog_(oldCreditCard); |
263 | 260 |
264 assertNotEquals(oldCreditCardDialog.title_, newCreditCardDialog.title_); | 261 assertNotEquals(oldCreditCardDialog.title_, newCreditCardDialog.title_); |
265 assertNotEquals('', newCreditCardDialog.title_); | 262 assertNotEquals('', newCreditCardDialog.title_); |
266 assertNotEquals('', oldCreditCardDialog.title_); | 263 assertNotEquals('', oldCreditCardDialog.title_); |
| 264 |
| 265 // Wait for dialogs to open before finishing test. |
| 266 return Promise.all([ |
| 267 test_util.whenAttributeIs(newCreditCardDialog.$.dialog, 'open', true), |
| 268 test_util.whenAttributeIs(oldCreditCardDialog.$.dialog, 'open', true), |
| 269 ]); |
267 }); | 270 }); |
268 | 271 |
269 test('verifyExpiredCreditCardYear', function() { | 272 test('verifyExpiredCreditCardYear', function() { |
270 var creditCard = FakeDataMaker.creditCardEntry(); | 273 var creditCard = FakeDataMaker.creditCardEntry(); |
271 | 274 |
272 // 2015 is over unless time goes wobbly. | 275 // 2015 is over unless time goes wobbly. |
273 var twentyFifteen = 2015; | 276 var twentyFifteen = 2015; |
274 creditCard.expirationYear = twentyFifteen.toString(); | 277 creditCard.expirationYear = twentyFifteen.toString(); |
275 | 278 |
276 var creditCardDialog = self.createCreditCardDialog_(creditCard); | 279 var creditCardDialog = self.createCreditCardDialog_(creditCard); |
(...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
916 assertEquals(city, cols[0].value); | 919 assertEquals(city, cols[0].value); |
917 assertEquals(state, cols[1].value); | 920 assertEquals(state, cols[1].value); |
918 assertEquals(zip, cols[2].value); | 921 assertEquals(zip, cols[2].value); |
919 }); | 922 }); |
920 }); | 923 }); |
921 }); | 924 }); |
922 }); | 925 }); |
923 | 926 |
924 mocha.run(); | 927 mocha.run(); |
925 }); | 928 }); |
OLD | NEW |