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

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

Issue 2936003003: MD Settings: Set all content setting values in Site Details Javascript. (Closed)
Patch Set: Review comments. Created 3 years, 5 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 18 matching lines...) Expand all
29 origin: 'https://foo-allow.com:443', 29 origin: 'https://foo-allow.com:443',
30 setting: 'allow', 30 setting: 'allow',
31 source: 'preference', 31 source: 'preference',
32 }, 32 },
33 ], 33 ],
34 camera: [ 34 camera: [
35 { 35 {
36 embeddingOrigin: 'https://foo-allow.com:443', 36 embeddingOrigin: 'https://foo-allow.com:443',
37 origin: 'https://foo-allow.com:443', 37 origin: 'https://foo-allow.com:443',
38 setting: 'allow', 38 setting: 'allow',
39 source: 'preference', 39 source: 'extension',
40 }, 40 },
41 ], 41 ],
42 cookies: [ 42 cookies: [
43 { 43 {
44 embeddingOrigin: 'https://foo-allow.com:443', 44 embeddingOrigin: 'https://foo-allow.com:443',
45 origin: 'https://foo-allow.com:443', 45 origin: 'https://foo-allow.com:443',
46 setting: 'allow', 46 setting: 'allow',
47 source: 'preference', 47 source: 'preference',
48 }, 48 },
49 ], 49 ],
50 geolocation: [ 50 geolocation: [
51 { 51 {
52 embeddingOrigin: 'https://foo-allow.com:443', 52 embeddingOrigin: 'https://foo-allow.com:443',
53 origin: 'https://foo-allow.com:443', 53 origin: 'https://foo-allow.com:443',
54 setting: 'allow', 54 setting: 'block',
55 source: 'preference', 55 source: 'policy',
56 }, 56 },
57 ], 57 ],
58 images: [ 58 images: [
59 { 59 {
60 embeddingOrigin: 'https://foo-allow.com:443', 60 embeddingOrigin: 'https://foo-allow.com:443',
61 origin: 'https://foo-allow.com:443', 61 origin: 'https://foo-allow.com:443',
62 setting: 'allow', 62 setting: 'allow',
63 source: 'preference', 63 source: 'preference',
64 }, 64 },
65 ], 65 ],
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 134
135 fetchUsageTotal: function(origin) { 135 fetchUsageTotal: function(origin) {
136 testElement.storedData_ = '1 KB'; 136 testElement.storedData_ = '1 KB';
137 }, 137 },
138 }); 138 });
139 var api = document.createElement('mock-website-usage-private-api'); 139 var api = document.createElement('mock-website-usage-private-api');
140 testElement.$.usageApi = api; 140 testElement.$.usageApi = api;
141 Polymer.dom(parent).appendChild(api); 141 Polymer.dom(parent).appendChild(api);
142 142
143 browserProxy.setPrefs(prefs); 143 browserProxy.setPrefs(prefs);
144 testElement.site = { 144 testElement.origin = 'https://foo-allow.com:443';
145 origin: 'https://foo-allow.com:443',
146 displayName: 'https://foo-allow.com:443',
147 embeddingOrigin: '',
148 };
149 145
150 Polymer.dom.flush(); 146 Polymer.dom.flush();
151 147
152 // expect usage to be rendered 148 // Expect usage to be rendered.
153 assertTrue(!!testElement.$$('#usage')); 149 assertTrue(!!testElement.$$('#usage'));
154 }); 150 });
151
152 test('correct pref settings are shown', function() {
153 browserProxy.setPrefs(prefs);
154 testElement.origin = 'https://foo-allow.com:443';
155
156 return browserProxy.whenCalled('getOriginPermissions').then(function() {
157 testElement.root.querySelectorAll('site-details-permission')
158 .forEach(function(siteDetailsPermission) {
159 // Verify settings match the values specified in |prefs|.
160 var setting = 'allow';
161 if (siteDetailsPermission.site.category == 'location')
162 setting = 'block';
163 assertEquals(setting, siteDetailsPermission.site.setting);
164 assertEquals(setting, siteDetailsPermission.$.permission.value);
165 });
166 });
167 });
155 }); 168 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698