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

Side by Side Diff: chrome/browser/ui/webui/options/chromeos/shared_options_browsertest.cc

Issue 536703002: Get rid of some <label for> misuse in browser_options.html (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix tests Created 6 years, 3 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/compiler_specific.h" 6 #include "base/compiler_specific.h"
7 #include "base/prefs/pref_service.h" 7 #include "base/prefs/pref_service.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "chrome/browser/chromeos/login/login_manager_test.h" 9 #include "chrome/browser/chromeos/login/login_manager_test.h"
10 #include "chrome/browser/chromeos/login/startup_utils.h" 10 #include "chrome/browser/chromeos/login/startup_utils.h"
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 std::string controlled_by) { 151 std::string controlled_by) {
152 bool success; 152 bool success;
153 std::string js_expression = base::StringPrintf( 153 std::string js_expression = base::StringPrintf(
154 "var prefSelector = '[pref=\"%s\"]';" 154 "var prefSelector = '[pref=\"%s\"]';"
155 "var controlledBy = '%s';" 155 "var controlledBy = '%s';"
156 "var input = document.querySelector(" 156 "var input = document.querySelector("
157 " 'input' + prefSelector + ', select' + prefSelector);" 157 " 'input' + prefSelector + ', select' + prefSelector);"
158 "var success = false;" 158 "var success = false;"
159 "if (input) {" 159 "if (input) {"
160 " success = input.disabled == %d;" 160 " success = input.disabled == %d;"
161 " var indicator = document.querySelector(input.tagName +" 161 " var indicator = input.parentNode.parentNode.querySelector("
162 " prefSelector + ' + span span.controlled-setting-indicator');" 162 " '.controlled-setting-indicator');"
163 " if (controlledBy) {" 163 " if (controlledBy) {"
164 " success = success && indicator &&" 164 " success = success && indicator &&"
165 " indicator.getAttribute('controlled-by') == controlledBy;" 165 " indicator.getAttribute('controlled-by') == controlledBy;"
166 " } else {" 166 " } else {"
167 " success = success && (!indicator ||" 167 " success = success && (!indicator ||"
168 " !indicator.hasAttribute('controlled-by') ||" 168 " !indicator.hasAttribute('controlled-by') ||"
169 " indicator.getAttribute('controlled-by') == '')" 169 " indicator.getAttribute('controlled-by') == '')"
170 " }" 170 " }"
171 "}" 171 "}"
172 "window.domAutomationController.send(!!success);", 172 "window.domAutomationController.send(!!success);",
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
422 content::WaitForLoadStop(contents); 422 content::WaitForLoadStop(contents);
423 { 423 {
424 SCOPED_TRACE("Screen lock false for both users"); 424 SCOPED_TRACE("Screen lock false for both users");
425 expected_value = false; 425 expected_value = false;
426 CheckBooleanPreference(contents, prefs::kEnableAutoScreenLock, disabled, 426 CheckBooleanPreference(contents, prefs::kEnableAutoScreenLock, disabled,
427 empty_controlled, expected_value); 427 empty_controlled, expected_value);
428 } 428 }
429 } 429 }
430 430
431 } // namespace chromeos 431 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/resources/options/controlled_setting.css ('k') | chrome/browser/ui/webui/options/options_browsertest.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698