| 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/utf_string_conversions.h" | 6 #include "base/utf_string_conversions.h" |
| 7 #include "content/browser/web_contents/web_contents_impl.h" | 7 #include "content/browser/web_contents/web_contents_impl.h" |
| 8 #include "content/public/common/content_switches.h" | 8 #include "content/public/common/content_switches.h" |
| 9 #include "content/public/test/browser_test_utils.h" | 9 #include "content/public/test/browser_test_utils.h" |
| 10 #include "content/shell/shell.h" | 10 #include "content/shell/shell.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 switches::kUseFakeDeviceForMediaStream)); | 26 switches::kUseFakeDeviceForMediaStream)); |
| 27 | 27 |
| 28 ASSERT_TRUE(test_server()->Start()); | 28 ASSERT_TRUE(test_server()->Start()); |
| 29 ContentBrowserTest::SetUp(); | 29 ContentBrowserTest::SetUp(); |
| 30 } | 30 } |
| 31 protected: | 31 protected: |
| 32 bool ExecuteJavascript(const std::string& javascript) { | 32 bool ExecuteJavascript(const std::string& javascript) { |
| 33 RenderViewHost* render_view_host = | 33 RenderViewHost* render_view_host = |
| 34 shell()->web_contents()->GetRenderViewHost(); | 34 shell()->web_contents()->GetRenderViewHost(); |
| 35 | 35 |
| 36 return ExecuteJavaScript(render_view_host, "", javascript); | 36 return ExecuteJavaScript(render_view_host, L"", ASCIIToWide(javascript)); |
| 37 } | 37 } |
| 38 | 38 |
| 39 void ExpectTitle(const std::string& expected_title) const { | 39 void ExpectTitle(const std::string& expected_title) const { |
| 40 string16 expected_title16(ASCIIToUTF16(expected_title)); | 40 string16 expected_title16(ASCIIToUTF16(expected_title)); |
| 41 TitleWatcher title_watcher(shell()->web_contents(), expected_title16); | 41 TitleWatcher title_watcher(shell()->web_contents(), expected_title16); |
| 42 EXPECT_EQ(expected_title16, title_watcher.WaitAndGetTitle()); | 42 EXPECT_EQ(expected_title16, title_watcher.WaitAndGetTitle()); |
| 43 } | 43 } |
| 44 }; | 44 }; |
| 45 | 45 |
| 46 // These tests will all make a getUserMedia call with different constraints and | 46 // These tests will all make a getUserMedia call with different constraints and |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 CanSetupAudioAndVideoCallWithoutMsidAndBundle) { | 90 CanSetupAudioAndVideoCallWithoutMsidAndBundle) { |
| 91 GURL url(test_server()->GetURL("files/media/peerconnection-call.html")); | 91 GURL url(test_server()->GetURL("files/media/peerconnection-call.html")); |
| 92 NavigateToURL(shell(), url); | 92 NavigateToURL(shell(), url); |
| 93 | 93 |
| 94 EXPECT_TRUE(ExecuteJavascript("callWithoutMsidAndBundle();")); | 94 EXPECT_TRUE(ExecuteJavascript("callWithoutMsidAndBundle();")); |
| 95 ExpectTitle("OK"); | 95 ExpectTitle("OK"); |
| 96 } | 96 } |
| 97 | 97 |
| 98 } // namespace content | 98 } // namespace content |
| 99 | 99 |
| OLD | NEW |