| OLD | NEW |
| 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 #include "chrome/browser/chrome_notification_types.h" | 5 #include "chrome/browser/chrome_notification_types.h" |
| 6 #include "chrome/browser/chromeos/login/test/oobe_base_test.h" | 6 #include "chrome/browser/chromeos/login/test/oobe_base_test.h" |
| 7 #include "chrome/browser/chromeos/login/ui/webui_login_display.h" | 7 #include "chrome/browser/chromeos/login/ui/webui_login_display.h" |
| 8 #include "chromeos/chromeos_switches.h" | 8 #include "chromeos/chromeos_switches.h" |
| 9 #include "content/public/test/browser_test_utils.h" | 9 #include "content/public/test/browser_test_utils.h" |
| 10 #include "content/public/test/test_utils.h" | 10 #include "content/public/test/test_utils.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 | 39 |
| 40 ASSERT_TRUE(content::ExecuteScript( | 40 ASSERT_TRUE(content::ExecuteScript( |
| 41 GetLoginUI()->GetWebContents(), | 41 GetLoginUI()->GetWebContents(), |
| 42 "$('gaia-signin').gaiaAuthHost_.addEventListener('ready'," | 42 "$('gaia-signin').gaiaAuthHost_.addEventListener('ready'," |
| 43 "function() {" | 43 "function() {" |
| 44 "window.domAutomationController.setAutomationId(0);" | 44 "window.domAutomationController.setAutomationId(0);" |
| 45 "window.domAutomationController.send('GaiaReady');" | 45 "window.domAutomationController.send('GaiaReady');" |
| 46 "});")); | 46 "});")); |
| 47 | 47 |
| 48 content::DOMMessageQueue message_queue; | 48 content::DOMMessageQueue message_queue; |
| 49 GetLoginDisplay()->ShowSigninScreenForCreds("", ""); | |
| 50 | |
| 51 std::string message; | 49 std::string message; |
| 52 ASSERT_TRUE(message_queue.WaitForMessage(&message)); | 50 ASSERT_TRUE(message_queue.WaitForMessage(&message)); |
| 53 EXPECT_EQ("\"GaiaReady\"", message); | 51 EXPECT_EQ("\"GaiaReady\"", message); |
| 54 } | 52 } |
| 55 | 53 |
| 56 private: | 54 private: |
| 57 DISALLOW_COPY_AND_ASSIGN(WebviewLoginTest); | 55 DISALLOW_COPY_AND_ASSIGN(WebviewLoginTest); |
| 58 }; | 56 }; |
| 59 | 57 |
| 60 IN_PROC_BROWSER_TEST_F(WebviewLoginTest, Basic) { | 58 IN_PROC_BROWSER_TEST_F(WebviewLoginTest, Basic) { |
| (...skipping 10 matching lines...) Expand all Loading... |
| 71 chrome::NOTIFICATION_SESSION_STARTED, | 69 chrome::NOTIFICATION_SESSION_STARTED, |
| 72 content::NotificationService::AllSources()); | 70 content::NotificationService::AllSources()); |
| 73 | 71 |
| 74 SetSignFormField("password", kFakeUserPassword); | 72 SetSignFormField("password", kFakeUserPassword); |
| 75 ExecuteJsInSigninFrame("document.getElementById('nextButton').click();"); | 73 ExecuteJsInSigninFrame("document.getElementById('nextButton').click();"); |
| 76 | 74 |
| 77 session_start_waiter.Wait(); | 75 session_start_waiter.Wait(); |
| 78 } | 76 } |
| 79 | 77 |
| 80 } // namespace chromeos | 78 } // namespace chromeos |
| OLD | NEW |