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

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: Augment test 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
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..d47657736a0ca194518622ac0bfa899aa4ae212d 100644
--- a/chrome/test/data/webui/settings/site_details_tests.js
+++ b/chrome/test/data/webui/settings/site_details_tests.js
@@ -109,10 +109,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 +140,29 @@ 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;
michaelpg 2016/01/25 18:33:54 see Element.prototype.remove
Finnur 2016/01/26 15:54:54 Done.
michaelpg 2016/01/27 06:37:46 Sorry, that was silly of me: i meant that the node
Finnur 2016/01/27 10:27:26 Done.
+ Polymer.dom(parent).removeChild(testElement.$.usageApi);
+
+ // Replace it with a mock version.
+ Polymer({
+ is:"mock-website-usage-private-api",
michaelpg 2016/01/25 18:33:54 use single quotes in JS, here & below
michaelpg 2016/01/25 18:33:54 space
Finnur 2016/01/26 15:54:54 Done. Here & below & above. :)
+ fetchUsageTotal: function(origin) {
+ testElement.storedData_ = '1 KB';
+ },
+ });
+ var api = document.createElement("mock-website-usage-private-api");
+ testElement.$['usageApi'] = api;
michaelpg 2016/01/25 18:33:54 $.usageApi
Finnur 2016/01/26 15:54:54 Done.
+ Polymer.dom(parent).appendChild(api);
+
+ testElement.prefs = prefs;
+ testElement.origin = "https://foo-allow.com:443";
+
+ assertFalse(testElement.$.usage.hidden);
+ assertFalse(testElement.$.storage.hidden);
+ });
});
}
return {
« chrome/browser/ui/webui/settings/site_settings_handler.h ('K') | « chrome/chrome_browser_ui.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698