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

Side by Side Diff: chrome/browser/chromeos/login/lock/screen_locker_tester.cc

Issue 1257603003: Revert of Add ExecuteJavaScriptForTest and make all tests use it (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 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 "chrome/browser/chromeos/login/lock/screen_locker_tester.h" 5 #include "chrome/browser/chromeos/login/lock/screen_locker_tester.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 // Returns the ScreenLockerWebUI object. 111 // Returns the ScreenLockerWebUI object.
112 WebUIScreenLocker* webui_screen_locker() const; 112 WebUIScreenLocker* webui_screen_locker() const;
113 113
114 // Returns the WebUI object from the screen locker. 114 // Returns the WebUI object from the screen locker.
115 content::WebUI* webui() const; 115 content::WebUI* webui() const;
116 116
117 DISALLOW_COPY_AND_ASSIGN(WebUIScreenLockerTester); 117 DISALLOW_COPY_AND_ASSIGN(WebUIScreenLockerTester);
118 }; 118 };
119 119
120 void WebUIScreenLockerTester::SetPassword(const std::string& password) { 120 void WebUIScreenLockerTester::SetPassword(const std::string& password) {
121 webui()->GetWebContents()->GetMainFrame()->ExecuteJavaScriptForTests( 121 webui()->GetWebContents()->GetMainFrame()->ExecuteJavaScript(
122 base::ASCIIToUTF16(base::StringPrintf( 122 base::ASCIIToUTF16(base::StringPrintf(
123 "$('pod-row').pods[0].passwordElement.value = '%s';", 123 "$('pod-row').pods[0].passwordElement.value = '%s';",
124 password.c_str()))); 124 password.c_str())));
125 } 125 }
126 126
127 std::string WebUIScreenLockerTester::GetPassword() { 127 std::string WebUIScreenLockerTester::GetPassword() {
128 std::string result; 128 std::string result;
129 scoped_ptr<base::Value> v = content::ExecuteScriptAndGetValue( 129 scoped_ptr<base::Value> v = content::ExecuteScriptAndGetValue(
130 RenderViewHost()->GetMainFrame(), 130 RenderViewHost()->GetMainFrame(),
131 "$('pod-row').pods[0].passwordElement.value;"); 131 "$('pod-row').pods[0].passwordElement.value;");
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 new FakeExtendedAuthenticator(ScreenLocker::screen_locker_, user_context); 209 new FakeExtendedAuthenticator(ScreenLocker::screen_locker_, user_context);
210 } 210 }
211 211
212 } // namespace test 212 } // namespace test
213 213
214 test::ScreenLockerTester* ScreenLocker::GetTester() { 214 test::ScreenLockerTester* ScreenLocker::GetTester() {
215 return new test::WebUIScreenLockerTester(); 215 return new test::WebUIScreenLockerTester();
216 } 216 }
217 217
218 } // namespace chromeos 218 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/apps/custom_launcher_page_browsertest_views.cc ('k') | chrome/browser/download/download_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698