Chromium Code Reviews| Index: chrome/test/data/webui/settings/site_details_tests.js |
| diff --git a/chrome/test/data/webui/settings/site_details_tests.js b/chrome/test/data/webui/settings/site_details_tests.js |
| index bb81b2e0f866794bd8ae0d43fbdbc270e091eb0b..cf89ed6165c76dbf53bf389884fe5b5c0bfb0433 100644 |
| --- a/chrome/test/data/webui/settings/site_details_tests.js |
| +++ b/chrome/test/data/webui/settings/site_details_tests.js |
| @@ -2,6 +2,14 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| +function MockUsageHandler(element) { |
| + this.testElement = element; |
| +} |
| + |
| +MockUsageHandler.prototype.fetchUsageTotal = function(origin) { |
| + this.testElement.$.storedData_ = '1 KB'; |
| +}; |
|
Finnur
2016/01/22 15:52:15
This is purely here to facilitate discussion. I ra
Finnur
2016/01/25 11:19:16
Ignore the comment above, this code is obsolete.
|
| + |
| /** @fileoverview Suite of tests for site-details. */ |
| cr.define('site_details', function() { |
| function registerTests() { |
| @@ -109,10 +117,8 @@ cr.define('site_details', function() { |
| testElement.prefs = prefsEmpty; |
| testElement.origin = "http://www.google.com"; |
| - // Once actual storage numbers are shown (instead of hard-coded), these |
| - // two will become hidden by default. |
| - assertFalse(testElement.$.usage.hidden); |
| - assertFalse(testElement.$.storage.hidden); |
| + assertTrue(testElement.$.usage.hidden); |
| + assertTrue(testElement.$.storage.hidden); |
| // TODO(finnur): Check for the Permission heading hiding when no |
| // permissions are showing. |
| @@ -142,6 +148,16 @@ cr.define('site_details', function() { |
| assertNotEquals(0, testElement.$.notification.offsetHeight, msg); |
| assertNotEquals(0, testElement.$.popups.offsetHeight, msg); |
| }); |
| + |
| + test('usage heading shows on storage available', function() { |
| + testElement.$.usageApi = new MockUsageHandler(testElement); |
| + testElement.prefs = prefs; |
| + testElement.origin = "https://foo-allow.com:443"; |
| + Polymer.dom.flush(); |
| + |
| + assertFalse(testElement.$.usage.hidden); |
| + assertFalse(testElement.$.storage.hidden); |
| + }); |
| }); |
| } |
| return { |