| 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 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 412 test('verifyAddressFields', function() { | 412 test('verifyAddressFields', function() { |
| 413 var address = FakeDataMaker.addressEntry(); | 413 var address = FakeDataMaker.addressEntry(); |
| 414 var section = self.createAutofillSection_([address], []); | 414 var section = self.createAutofillSection_([address], []); |
| 415 var addressList = section.$.addressList; | 415 var addressList = section.$.addressList; |
| 416 var row = addressList.children[0]; | 416 var row = addressList.children[0]; |
| 417 assertTrue(!!row); | 417 assertTrue(!!row); |
| 418 | 418 |
| 419 var addressSummary = address.metadata.summaryLabel + | 419 var addressSummary = address.metadata.summaryLabel + |
| 420 address.metadata.summarySublabel; | 420 address.metadata.summarySublabel; |
| 421 | 421 |
| 422 assertEquals(addressSummary, | 422 var actualSummary = ''; |
| 423 row.querySelector('#addressSummary').textContent); | 423 |
| 424 // Eliminate white space between nodes! |
| 425 var addressPieces = row.querySelector('#addressSummary').children; |
| 426 for (var i = 0; i < addressPieces.length; ++i) { |
| 427 actualSummary += addressPieces[i].textContent.trim(); |
| 428 } |
| 429 |
| 430 assertEquals(addressSummary, actualSummary); |
| 424 }); | 431 }); |
| 425 | 432 |
| 426 test('verifyAddAddressDialog', function() { | 433 test('verifyAddAddressDialog', function() { |
| 427 return self.createAddressDialog_( | 434 return self.createAddressDialog_( |
| 428 FakeDataMaker.emptyAddressEntry()).then(function(dialog) { | 435 FakeDataMaker.emptyAddressEntry()).then(function(dialog) { |
| 429 var title = dialog.$$('.title'); | 436 var title = dialog.$$('.title'); |
| 430 assertEquals(loadTimeData.getString('addAddress'), title.textContent); | 437 assertEquals(loadTimeData.getString('addAddress'), title.textContent); |
| 431 // Shouldn't be possible to save until something is typed in. | 438 // Shouldn't be possible to save until something is typed in. |
| 432 assertTrue(dialog.$.saveButton.disabled); | 439 assertTrue(dialog.$.saveButton.disabled); |
| 433 }); | 440 }); |
| (...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 836 assertEquals(city, cols[0].value); | 843 assertEquals(city, cols[0].value); |
| 837 assertEquals(state, cols[1].value); | 844 assertEquals(state, cols[1].value); |
| 838 assertEquals(zip, cols[2].value); | 845 assertEquals(zip, cols[2].value); |
| 839 }); | 846 }); |
| 840 }); | 847 }); |
| 841 }); | 848 }); |
| 842 }); | 849 }); |
| 843 | 850 |
| 844 mocha.run(); | 851 mocha.run(); |
| 845 }); | 852 }); |
| OLD | NEW |