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

Side by Side Diff: chrome/test/data/webui/settings/site_details_tests.js

Issue 2912253003: MD Settings: Show all content settings in Site Details. (Closed)
Patch Set: Delete Site Details test that checks permissions are hidden. Created 3 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** @fileoverview Suite of tests for site-details. */ 5 /** @fileoverview Suite of tests for site-details. */
6 suite('SiteDetails', function() { 6 suite('SiteDetails', function() {
7 /** 7 /**
8 * A site list element created before each test. 8 * A site list element created before each test.
9 * @type {SiteDetails} 9 * @type {SiteDetails}
10 */ 10 */
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 108
109 // Initialize a site-details before each test. 109 // Initialize a site-details before each test.
110 setup(function() { 110 setup(function() {
111 browserProxy = new TestSiteSettingsPrefsBrowserProxy(); 111 browserProxy = new TestSiteSettingsPrefsBrowserProxy();
112 settings.SiteSettingsPrefsBrowserProxyImpl.instance_ = browserProxy; 112 settings.SiteSettingsPrefsBrowserProxyImpl.instance_ = browserProxy;
113 PolymerTest.clearBody(); 113 PolymerTest.clearBody();
114 testElement = document.createElement('site-details'); 114 testElement = document.createElement('site-details');
115 document.body.appendChild(testElement); 115 document.body.appendChild(testElement);
116 }); 116 });
117 117
118 test('empty state', function() { 118 test('all categories', function() {
119 var category = settings.ContentSettingsTypes.NOTIFICATIONS;
120 var site = {
121 origin: 'http://www.google.com',
122 displayName: 'http://www.google.com',
123 embeddingOrigin: '',
124 };
125 browserProxy.setPrefs(prefsEmpty);
126 testElement.category = category;
127 testElement.site = site
128
129 // expect usage to not be rendered
130 assertFalse(!!testElement.$$('#usage'));
131
132 // TODO(finnur): Check for the Permission heading hiding when no
133 // permissions are showing.
134
135 var msg = 'No category should be showing, height';
136 assertEquals(0, testElement.$.camera.offsetHeight, msg);
137 assertEquals(0, testElement.$.cookies.offsetHeight, msg);
138 assertEquals(0, testElement.$.geolocation.offsetHeight, msg);
139 assertEquals(0, testElement.$.javascript.offsetHeight, msg);
140 assertEquals(0, testElement.$.mic.offsetHeight, msg);
141 assertEquals(0, testElement.$.notification.offsetHeight, msg);
142 assertEquals(0, testElement.$.popups.offsetHeight, msg);
143 });
144
145 test('all categories visible', function() {
146 var category = settings.ContentSettingsTypes.NOTIFICATIONS; 119 var category = settings.ContentSettingsTypes.NOTIFICATIONS;
147 var site = { 120 var site = {
148 origin: 'https://foo-allow.com:443', 121 origin: 'https://foo-allow.com:443',
149 displayName: 'https://foo-allow.com:443', 122 displayName: 'https://foo-allow.com:443',
150 embeddingOrigin: '', 123 embeddingOrigin: '',
151 }; 124 };
152 125
153 browserProxy.setPrefs(prefs); 126 browserProxy.setPrefs(prefs);
154 testElement.category = category; 127 testElement.category = category;
155 testElement.site = site; 128 testElement.site = site;
156 129
157 var msg = 'All categories should be showing'; 130 var msg = 'All categories should be showing';
158 assertFalse(testElement.$.camera.hidden, msg); 131 assertTrue(!!testElement.$.automaticDownloads);
159 assertFalse(testElement.$.cookies.hidden, msg); 132 assertTrue(!!testElement.$.backgroundSync);
160 assertFalse(testElement.$.geolocation.hidden, msg); 133 assertTrue(!!testElement.$.camera);
161 assertFalse(testElement.$.javascript.hidden, msg); 134 assertTrue(!!testElement.$.cookies);
162 assertFalse(testElement.$.mic.hidden, msg); 135 assertTrue(!!testElement.$.geolocation);
163 assertFalse(testElement.$.notification.hidden, msg); 136 assertTrue(!!testElement.$.javascript);
164 assertFalse(testElement.$.popups.hidden, msg); 137 assertTrue(!!testElement.$.mic);
138 assertTrue(!!testElement.$.notifications);
139 assertTrue(!!testElement.$.plugins);
140 assertTrue(!!testElement.$.popups);
141 assertTrue(!!testElement.$.unsandboxedPlugins);
calamity 2017/06/01 03:46:56 I don't this tests what you want it to. It just ch
Patti Lor 2017/06/01 04:52:01 Done! Thanks, I was kinda unsure if it was really
165 }); 142 });
166 143
167 test('usage heading shows on storage available', function() { 144 test('usage heading shows on storage available', function() {
168 // Remove the current website-usage-private-api element. 145 // Remove the current website-usage-private-api element.
169 var parent = testElement.$.usageApi.parentNode; 146 var parent = testElement.$.usageApi.parentNode;
170 testElement.$.usageApi.remove(); 147 testElement.$.usageApi.remove();
171 148
172 // Replace it with a mock version. 149 // Replace it with a mock version.
173 Polymer({ 150 Polymer({
174 is: 'mock-website-usage-private-api', 151 is: 'mock-website-usage-private-api',
(...skipping 12 matching lines...) Expand all
187 displayName: 'https://foo-allow.com:443', 164 displayName: 'https://foo-allow.com:443',
188 embeddingOrigin: '', 165 embeddingOrigin: '',
189 }; 166 };
190 167
191 Polymer.dom.flush(); 168 Polymer.dom.flush();
192 169
193 // expect usage to be rendered 170 // expect usage to be rendered
194 assertTrue(!!testElement.$$('#usage')); 171 assertTrue(!!testElement.$$('#usage'));
195 }); 172 });
196 }); 173 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698