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

Unified Diff: chrome/test/data/webui/settings/site_details_tests.js

Issue 1607483005: Show data usage on Site Details (MDSettings) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Test (WIP) Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/chrome_browser_ui.gypi ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 {
« no previous file with comments | « chrome/chrome_browser_ui.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698