OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/test/remoting/remote_desktop_browsertest.h" | 5 #include "chrome/test/remoting/remote_desktop_browsertest.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
302 // active_web_contents() is still the login window but the observer | 302 // active_web_contents() is still the login window but the observer |
303 // should be set up to observe the chromoting window because that is | 303 // should be set up to observe the chromoting window because that is |
304 // where we'll receive the message from the login window and reload the | 304 // where we'll receive the message from the login window and reload the |
305 // chromoting app. | 305 // chromoting app. |
306 content::WindowedNotificationObserver observer( | 306 content::WindowedNotificationObserver observer( |
307 content::NOTIFICATION_LOAD_STOP, | 307 content::NOTIFICATION_LOAD_STOP, |
308 base::Bind( | 308 base::Bind( |
309 &RemoteDesktopBrowserTest::IsAuthenticatedInWindow, | 309 &RemoteDesktopBrowserTest::IsAuthenticatedInWindow, |
310 browser()->tab_strip_model()->GetActiveWebContents())); | 310 browser()->tab_strip_model()->GetActiveWebContents())); |
311 | 311 |
312 ExecuteScript( | 312 while (!IsEnabled("submit_approve_access")) { |
weitao
2014/09/08 23:07:48
You should use a ConditionalWaiter for this. And w
anandc1
2014/09/09 00:59:16
Done.
| |
313 "lso.approveButtonAction();" | 313 ASSERT_TRUE(TimeoutWaiter(base::TimeDelta::FromSeconds(1)).Wait()); |
314 "document.forms[\"connect-approve\"].submit();"); | 314 } |
315 | |
316 ClickOnControl("submit_approve_access"); | |
315 | 317 |
316 observer.Wait(); | 318 observer.Wait(); |
317 | 319 |
318 // Popping the login window off the stack to return to the chromoting | 320 // Popping the login window off the stack to return to the chromoting |
319 // window. | 321 // window. |
320 web_contents_stack_.pop_back(); | 322 web_contents_stack_.pop_back(); |
321 } | 323 } |
322 | 324 |
323 ASSERT_TRUE(GetCurrentURL() == Chromoting_Main_URL()); | 325 ASSERT_TRUE(GetCurrentURL() == Chromoting_Main_URL()); |
324 | 326 |
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
795 // static | 797 // static |
796 bool RemoteDesktopBrowserTest::IsHostActionComplete( | 798 bool RemoteDesktopBrowserTest::IsHostActionComplete( |
797 content::WebContents* client_web_content, | 799 content::WebContents* client_web_content, |
798 std::string host_action_var) { | 800 std::string host_action_var) { |
799 return ExecuteScriptAndExtractBool( | 801 return ExecuteScriptAndExtractBool( |
800 client_web_content, | 802 client_web_content, |
801 host_action_var); | 803 host_action_var); |
802 } | 804 } |
803 | 805 |
804 } // namespace remoting | 806 } // namespace remoting |
OLD | NEW |