OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |