| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/debug/trace_event_impl.h" | 6 #include "base/debug/trace_event_impl.h" |
| 7 #include "base/json/json_reader.h" | 7 #include "base/json/json_reader.h" |
| 8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 "ns", | 123 "ns", |
| 124 true); | 124 true); |
| 125 } | 125 } |
| 126 | 126 |
| 127 protected: | 127 protected: |
| 128 bool ExecuteJavascript(const std::string& javascript) { | 128 bool ExecuteJavascript(const std::string& javascript) { |
| 129 return ExecuteScript(shell()->web_contents(), javascript); | 129 return ExecuteScript(shell()->web_contents(), javascript); |
| 130 } | 130 } |
| 131 | 131 |
| 132 void ExpectTitle(const std::string& expected_title) const { | 132 void ExpectTitle(const std::string& expected_title) const { |
| 133 string16 expected_title16(ASCIIToUTF16(expected_title)); | 133 base::string16 expected_title16(ASCIIToUTF16(expected_title)); |
| 134 TitleWatcher title_watcher(shell()->web_contents(), expected_title16); | 134 TitleWatcher title_watcher(shell()->web_contents(), expected_title16); |
| 135 EXPECT_EQ(expected_title16, title_watcher.WaitAndGetTitle()); | 135 EXPECT_EQ(expected_title16, title_watcher.WaitAndGetTitle()); |
| 136 } | 136 } |
| 137 }; | 137 }; |
| 138 | 138 |
| 139 // These tests will all make a getUserMedia call with different constraints and | 139 // These tests will all make a getUserMedia call with different constraints and |
| 140 // see that the success callback is called. If the error callback is called or | 140 // see that the success callback is called. If the error callback is called or |
| 141 // none of the callbacks are called the tests will simply time out and fail. | 141 // none of the callbacks are called the tests will simply time out and fail. |
| 142 IN_PROC_BROWSER_TEST_F(WebrtcBrowserTest, GetVideoStreamAndStop) { | 142 IN_PROC_BROWSER_TEST_F(WebrtcBrowserTest, GetVideoStreamAndStop) { |
| 143 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 143 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
| (...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 552 | 552 |
| 553 GURL url(embedded_test_server()->GetURL("/media/peerconnection-call.html")); | 553 GURL url(embedded_test_server()->GetURL("/media/peerconnection-call.html")); |
| 554 NavigateToURL(shell(), url); | 554 NavigateToURL(shell(), url); |
| 555 | 555 |
| 556 EXPECT_TRUE( | 556 EXPECT_TRUE( |
| 557 ExecuteJavascript("addTwoMediaStreamsToOneConnection();")); | 557 ExecuteJavascript("addTwoMediaStreamsToOneConnection();")); |
| 558 ExpectTitle("OK"); | 558 ExpectTitle("OK"); |
| 559 } | 559 } |
| 560 | 560 |
| 561 } // namespace content | 561 } // namespace content |
| OLD | NEW |