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

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: Fix update problem 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..38c519714c119617884026530100a3faba6d0abb 100644
--- a/chrome/test/data/webui/settings/site_details_tests.js
+++ b/chrome/test/data/webui/settings/site_details_tests.js
@@ -107,12 +107,10 @@ cr.define('site_details', function() {
test('empty state', function() {
testElement.prefs = prefsEmpty;
- testElement.origin = "http://www.google.com";
+ 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.
@@ -130,7 +128,7 @@ cr.define('site_details', function() {
test('all categories visible', function() {
testElement.prefs = prefs;
- testElement.origin = "https://foo-allow.com:443";
+ testElement.origin = 'https://foo-allow.com:443';
var msg = 'All categories should be showing';
assertNotEquals(0, testElement.$.camera.offsetHeight, msg);
@@ -142,6 +140,30 @@ 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() {
+ // Remove the current website-usage-private-api element.
+ var parent = testElement.$.usageApi.parentNode;
+ testElement.$.usageApi.remove();
+
+ // Replace it with a mock version.
+ Polymer({
+ is: 'mock-website-usage-private-api',
+
+ fetchUsageTotal: function(origin) {
+ testElement.storedData_ = '1 KB';
+ },
+ });
+ var api = document.createElement('mock-website-usage-private-api');
+ testElement.$.usageApi = api;
+ Polymer.dom(parent).appendChild(api);
+
+ testElement.prefs = prefs;
+ testElement.origin = 'https://foo-allow.com:443';
+
+ 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