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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/path_service.h" | 6 #include "base/path_service.h" |
7 #include "base/process/launch.h" | 7 #include "base/process/launch.h" |
8 #include "base/rand_util.h" | 8 #include "base/rand_util.h" |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 | 71 |
72 CommandLine command_line(CommandLine::NO_PROGRAM); | 72 CommandLine command_line(CommandLine::NO_PROGRAM); |
73 EXPECT_TRUE(GetPythonCommand(&command_line)); | 73 EXPECT_TRUE(GetPythonCommand(&command_line)); |
74 | 74 |
75 command_line.AppendArgPath(appengine_dev_appserver); | 75 command_line.AppendArgPath(appengine_dev_appserver); |
76 command_line.AppendArgPath(apprtc_dir); | 76 command_line.AppendArgPath(apprtc_dir); |
77 command_line.AppendArg("--port=9999"); | 77 command_line.AppendArg("--port=9999"); |
78 command_line.AppendArg("--admin_port=9998"); | 78 command_line.AppendArg("--admin_port=9998"); |
79 command_line.AppendArg("--skip_sdk_update_check"); | 79 command_line.AppendArg("--skip_sdk_update_check"); |
80 | 80 |
81 LOG(INFO) << "Running " << command_line.GetCommandLineString(); | 81 VLOG(0) << "Running " << command_line.GetCommandLineString(); |
82 return base::LaunchProcess(command_line, base::LaunchOptions(), | 82 return base::LaunchProcess(command_line, base::LaunchOptions(), |
83 &dev_appserver_); | 83 &dev_appserver_); |
84 } | 84 } |
85 | 85 |
86 bool LocalApprtcInstanceIsUp() { | 86 bool LocalApprtcInstanceIsUp() { |
87 // Load the admin page and see if we manage to load it right. | 87 // Load the admin page and see if we manage to load it right. |
88 ui_test_utils::NavigateToURL(browser(), GURL("localhost:9998")); | 88 ui_test_utils::NavigateToURL(browser(), GURL("localhost:9998")); |
89 content::WebContents* tab_contents = | 89 content::WebContents* tab_contents = |
90 browser()->tab_strip_model()->GetActiveWebContents(); | 90 browser()->tab_strip_model()->GetActiveWebContents(); |
91 std::string javascript = | 91 std::string javascript = |
(...skipping 23 matching lines...) Expand all Loading... |
115 return source_dir; | 115 return source_dir; |
116 } | 116 } |
117 | 117 |
118 private: | 118 private: |
119 base::ProcessHandle dev_appserver_; | 119 base::ProcessHandle dev_appserver_; |
120 }; | 120 }; |
121 | 121 |
122 IN_PROC_BROWSER_TEST_F(WebrtcApprtcBrowserTest, MANUAL_WorksOnApprtc) { | 122 IN_PROC_BROWSER_TEST_F(WebrtcApprtcBrowserTest, MANUAL_WorksOnApprtc) { |
123 ASSERT_TRUE(LaunchApprtcInstanceOnLocalhost()); | 123 ASSERT_TRUE(LaunchApprtcInstanceOnLocalhost()); |
124 while (!LocalApprtcInstanceIsUp()) | 124 while (!LocalApprtcInstanceIsUp()) |
125 LOG(INFO) << "Waiting for AppRTC to come up..."; | 125 VLOG(0) << "Waiting for AppRTC to come up..."; |
126 | 126 |
127 GURL room_url = GURL(base::StringPrintf("localhost:9999?r=room_%d", | 127 GURL room_url = GURL(base::StringPrintf("localhost:9999?r=room_%d", |
128 base::RandInt(0, 65536))); | 128 base::RandInt(0, 65536))); |
129 | 129 |
130 chrome::AddTabAt(browser(), GURL(), -1, true); | 130 chrome::AddTabAt(browser(), GURL(), -1, true); |
131 content::WebContents* left_tab = OpenPageAndAcceptUserMedia(room_url); | 131 content::WebContents* left_tab = OpenPageAndAcceptUserMedia(room_url); |
132 // TODO(phoglund): Remove when this bug gets fixed: | 132 // TODO(phoglund): Remove when this bug gets fixed: |
133 // http://code.google.com/p/webrtc/issues/detail?id=1742 | 133 // http://code.google.com/p/webrtc/issues/detail?id=1742 |
134 SleepInJavascript(left_tab, 5000); | 134 SleepInJavascript(left_tab, 5000); |
135 chrome::AddTabAt(browser(), GURL(), -1, true); | 135 chrome::AddTabAt(browser(), GURL(), -1, true); |
136 content::WebContents* right_tab = OpenPageAndAcceptUserMedia(room_url); | 136 content::WebContents* right_tab = OpenPageAndAcceptUserMedia(room_url); |
137 | 137 |
138 ASSERT_TRUE(WaitForCallToComeUp(left_tab)); | 138 ASSERT_TRUE(WaitForCallToComeUp(left_tab)); |
139 ASSERT_TRUE(WaitForCallToComeUp(right_tab)); | 139 ASSERT_TRUE(WaitForCallToComeUp(right_tab)); |
140 | 140 |
141 ASSERT_TRUE(StopApprtcInstance()); | 141 ASSERT_TRUE(StopApprtcInstance()); |
142 } | 142 } |
OLD | NEW |