| 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 | 81 |
| 82 } | 82 } |
| 83 | 83 |
| 84 namespace content { | 84 namespace content { |
| 85 | 85 |
| 86 class WebrtcBrowserTest: public ContentBrowserTest { | 86 class WebrtcBrowserTest: public ContentBrowserTest { |
| 87 public: | 87 public: |
| 88 WebrtcBrowserTest() {} | 88 WebrtcBrowserTest() {} |
| 89 virtual ~WebrtcBrowserTest() {} | 89 virtual ~WebrtcBrowserTest() {} |
| 90 | 90 |
| 91 virtual void SetUp() OVERRIDE { | |
| 92 // These tests require pixel output. | |
| 93 UseRealGLContexts(); | |
| 94 ContentBrowserTest::SetUp(); | |
| 95 } | |
| 96 | |
| 97 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 91 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
| 98 // We need fake devices in this test since we want to run on naked VMs. We | 92 // We need fake devices in this test since we want to run on naked VMs. We |
| 99 // assume these switches are set by default in content_browsertests. | 93 // assume these switches are set by default in content_browsertests. |
| 100 ASSERT_TRUE(CommandLine::ForCurrentProcess()->HasSwitch( | 94 ASSERT_TRUE(CommandLine::ForCurrentProcess()->HasSwitch( |
| 101 switches::kUseFakeDeviceForMediaStream)); | 95 switches::kUseFakeDeviceForMediaStream)); |
| 102 ASSERT_TRUE(CommandLine::ForCurrentProcess()->HasSwitch( | 96 ASSERT_TRUE(CommandLine::ForCurrentProcess()->HasSwitch( |
| 103 switches::kUseFakeUIForMediaStream)); | 97 switches::kUseFakeUIForMediaStream)); |
| 98 |
| 99 // The video playback will not work without a GPU, so force its use here. |
| 100 // This may not be available on all VMs though. |
| 101 command_line->AppendSwitch(switches::kUseGpuInTests); |
| 104 } | 102 } |
| 105 | 103 |
| 106 void DumpChromeTraceCallback( | 104 void DumpChromeTraceCallback( |
| 107 const scoped_refptr<base::RefCountedString>& events, | 105 const scoped_refptr<base::RefCountedString>& events, |
| 108 bool has_more_events) { | 106 bool has_more_events) { |
| 109 // Convert the dump output into a correct JSON List. | 107 // Convert the dump output into a correct JSON List. |
| 110 std::string contents = "[" + events->data() + "]"; | 108 std::string contents = "[" + events->data() + "]"; |
| 111 | 109 |
| 112 int error_code; | 110 int error_code; |
| 113 std::string error_message; | 111 std::string error_message; |
| (...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 798 EXPECT_TRUE(base::PathExists(dump_file)); | 796 EXPECT_TRUE(base::PathExists(dump_file)); |
| 799 int64 file_size = 0; | 797 int64 file_size = 0; |
| 800 EXPECT_TRUE(base::GetFileSize(dump_file, &file_size)); | 798 EXPECT_TRUE(base::GetFileSize(dump_file, &file_size)); |
| 801 EXPECT_EQ(0, file_size); | 799 EXPECT_EQ(0, file_size); |
| 802 | 800 |
| 803 base::DeleteFile(dump_file, false); | 801 base::DeleteFile(dump_file, false); |
| 804 } | 802 } |
| 805 | 803 |
| 806 | 804 |
| 807 } // namespace content | 805 } // namespace content |
| OLD | NEW |