Index: chrome/test/data/webui/settings/settings_autofill_section_browsertest.js |
diff --git a/chrome/test/data/webui/settings/settings_autofill_section_browsertest.js b/chrome/test/data/webui/settings/settings_autofill_section_browsertest.js |
index 4af3b281b2d2e29f41b9d23298e93ba72ece6e58..5431d452a7044ae7dbd830b3b5501bea0e731e6c 100644 |
--- a/chrome/test/data/webui/settings/settings_autofill_section_browsertest.js |
+++ b/chrome/test/data/webui/settings/settings_autofill_section_browsertest.js |
@@ -18,6 +18,7 @@ GEN_INCLUDE([ |
* @constructor |
*/ |
function CountryDetailManagerTestImpl() {} |
+ |
CountryDetailManagerTestImpl.prototype = { |
/** @override */ |
getCountryList: function() { |
@@ -126,9 +127,13 @@ SettingsAutofillSectionBrowserTest.prototype = { |
* @private |
*/ |
createAutofillSection_: function(addresses, creditCards) { |
+ // Override the AutofillManagerImpl for testing. |
+ this.autofillManager = new TestAutofillManager(); |
+ this.autofillManager.data.addresses = addresses; |
+ this.autofillManager.data.creditCards = creditCards; |
+ AutofillManagerImpl.instance_ = this.autofillManager; |
+ |
var section = document.createElement('settings-autofill-section'); |
- section.addresses = addresses; |
- section.creditCards = creditCards; |
document.body.appendChild(section); |
Polymer.dom.flush(); |
return section; |
@@ -168,6 +173,10 @@ SettingsAutofillSectionBrowserTest.prototype = { |
TEST_F('SettingsAutofillSectionBrowserTest', 'CreditCardTests', function() { |
var self = this; |
+ setup(function() { |
+ PolymerTest.clearBody(); |
+ }); |
+ |
suite('AutofillSection', function() { |
test('verifyCreditCardCount', function() { |
var section = self.createAutofillSection_([], []); |
@@ -402,6 +411,10 @@ TEST_F('SettingsAutofillSectionBrowserTest', 'CreditCardTests', function() { |
TEST_F('SettingsAutofillSectionBrowserTest', 'AddressTests', function() { |
var self = this; |
+ setup(function() { |
+ PolymerTest.clearBody(); |
+ }); |
+ |
suite('AutofillSection', function() { |
test('verifyNoAddresses', function() { |
var section = self.createAutofillSection_([], []); |
@@ -672,6 +685,10 @@ TEST_F('SettingsAutofillSectionBrowserTest', 'AddressTests', function() { |
TEST_F('SettingsAutofillSectionBrowserTest', 'AddressLocaleTests', function() { |
var self = this; |
+ setup(function() { |
+ PolymerTest.clearBody(); |
+ }); |
+ |
suite('AutofillSection', function() { |
// US address has 3 fields on the same line. |
test('verifyEditingUSAddress', function() { |