Index: chrome/test/remoting/it2me_browsertest.cc |
diff --git a/chrome/test/remoting/it2me_browsertest.cc b/chrome/test/remoting/it2me_browsertest.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..0ce60e33e950fa5c4863eeec6fcfc328640ee18c |
--- /dev/null |
+++ b/chrome/test/remoting/it2me_browsertest.cc |
@@ -0,0 +1,50 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "chrome/test/remoting/remote_desktop_browsertest.h" |
+ |
+namespace remoting { |
+ |
+class It2MeBrowserTest : public RemoteDesktopBrowserTest { |
+ protected: |
+ void SetUpTestForIt2Me(); |
+ std::string GetAccessCode(content::WebContents* contents); |
+}; |
+ |
+void It2MeBrowserTest::SetUpTestForIt2Me() { |
+ VerifyInternetAccess(); |
+ Install(); |
+ LaunchChromotingApp(false); |
+ Auth(); |
+ LoadScript(app_web_content(), FILE_PATH_LITERAL("browser_test.js")); |
Jamie
2015/01/06 22:18:51
This is basically the same code as RemoteDesktopBr
kelvinp
2015/01/09 22:21:30
Removed.
|
+} |
+ |
+std::string It2MeBrowserTest::GetAccessCode(content::WebContents* contents) { |
+ base::Value* return_value = nullptr; |
+ RunJavaScriptTest(contents, "GET_ACCESS_CODE", "{}", &return_value); |
Jamie
2015/01/06 22:18:51
GET_ACCESS_CODE is not a test in the same sense th
kelvinp
2015/01/09 22:21:29
Discussed offline
|
+ scoped_ptr<base::Value> owned_value(return_value); |
+ std::string access_code; |
+ owned_value->GetAsString(&access_code); |
+ return access_code; |
+} |
+ |
+IN_PROC_BROWSER_TEST_F(It2MeBrowserTest, MANUAL_Connect) { |
+ SetUpTestForIt2Me(); |
+ |
+ content::WebContents* helpee_content = app_web_content(); |
+ LoadScript(helpee_content, FILE_PATH_LITERAL("it2me_browser_test.js")); |
+ |
+ LaunchChromotingApp(false /* defer_start*/, NEW_FOREGROUND_TAB); |
Jamie
2015/01/06 22:18:51
Does NEW_FOREGROUND_TAB work for apps v2?
Jamie
2015/01/06 22:18:51
We haven't documented the |false| parameter anywhe
kelvinp
2015/01/09 22:21:29
Good point. Comment added and modified the code t
kelvinp
2015/01/09 22:21:30
Done.
|
+ content::WebContents* helper_content = active_web_contents(); |
Jamie
2015/01/06 22:18:51
Would it be possible to return the web contents fr
kelvinp
2015/01/09 22:21:30
Done.
|
+ LoadScript(helper_content, FILE_PATH_LITERAL("browser_test.js")); |
+ LoadScript(helper_content, FILE_PATH_LITERAL("it2me_browser_test.js")); |
+ |
+ RunJavaScriptTest(helper_content, "CONNECT_IT2ME", "{" |
+ "accessCode: '" + GetAccessCode(helpee_content) + "'" |
+ "}"); |
+ |
+ Cleanup(); |
+} |
Jamie
2015/01/06 22:18:51
Can you also add a test to make sure that trying t
kelvinp
2015/01/09 22:21:30
Done.
|
+ |
+} // namespace remoting |