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

Side by Side Diff: chrome/browser/policy/policy_prefs_browsertest.cc

Issue 11117024: Add second batch of controlled setting indicators (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix browser test. Created 8 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/resources/options/browser_options.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include <algorithm> 5 #include <algorithm>
6 #include <map> 6 #include <map>
7 #include <sstream> 7 #include <sstream>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 } 291 }
292 292
293 void VerifyControlledSettingIndicators(Browser* browser, 293 void VerifyControlledSettingIndicators(Browser* browser,
294 const std::string& pref, 294 const std::string& pref,
295 const std::string& value, 295 const std::string& value,
296 const std::string& controlled_by, 296 const std::string& controlled_by,
297 bool readonly) { 297 bool readonly) {
298 std::wstringstream javascript; 298 std::wstringstream javascript;
299 javascript << "var nodes = document.querySelectorAll(" 299 javascript << "var nodes = document.querySelectorAll("
300 << " 'span.controlled-setting-indicator[" 300 << " 'span.controlled-setting-indicator["
301 << " pref=" << pref.c_str() << "]');" 301 << " pref=\"" << pref.c_str() << "\"]');"
302 << "var indicators = [];" 302 << "var indicators = [];"
303 << "for (var i = 0; i < nodes.length; i++) {" 303 << "for (var i = 0; i < nodes.length; i++) {"
304 << " var node = nodes[i];" 304 << " var node = nodes[i];"
305 << " var indicator = {};" 305 << " var indicator = {};"
306 << " indicator.value = node.value || '';" 306 << " indicator.value = node.value || '';"
307 << " indicator.controlledBy = node.controlledBy || '';" 307 << " indicator.controlledBy = node.controlledBy || '';"
308 << " indicator.readOnly = node.readOnly || false;" 308 << " indicator.readOnly = node.readOnly || false;"
309 << " indicator.visible =" 309 << " indicator.visible ="
310 << " window.getComputedStyle(node).display != 'none';" 310 << " window.getComputedStyle(node).display != 'none';"
311 << " indicators.push(indicator)" 311 << " indicators.push(indicator)"
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 } 537 }
538 } 538 }
539 539
540 INSTANTIATE_TEST_CASE_P( 540 INSTANTIATE_TEST_CASE_P(
541 PolicyPrefsTestInstance, 541 PolicyPrefsTestInstance,
542 PolicyPrefsTest, 542 PolicyPrefsTest,
543 testing::ValuesIn(GetChromePolicyDefinitionList()->begin, 543 testing::ValuesIn(GetChromePolicyDefinitionList()->begin,
544 GetChromePolicyDefinitionList()->end)); 544 GetChromePolicyDefinitionList()->end));
545 545
546 } // namespace policy 546 } // namespace policy
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/resources/options/browser_options.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698