OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "content/test/ppapi/ppapi_test.h" | 5 #include "content/test/ppapi/ppapi_test.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
11 #include "base/strings/string_util.h" | 11 #include "base/strings/string_util.h" |
12 #include "base/strings/stringprintf.h" | 12 #include "base/strings/stringprintf.h" |
13 #include "content/public/browser/web_contents.h" | 13 #include "content/public/browser/web_contents.h" |
14 #include "content/public/common/content_switches.h" | 14 #include "content/public/common/content_switches.h" |
15 #include "content/shell/browser/shell.h" | 15 #include "content/shell/browser/shell.h" |
16 #include "net/base/filename_util.h" | 16 #include "net/base/filename_util.h" |
17 #include "ppapi/shared_impl/ppapi_switches.h" | 17 #include "ppapi/shared_impl/ppapi_switches.h" |
18 #include "ppapi/shared_impl/test_harness_utils.h" | 18 #include "ppapi/shared_impl/test_harness_utils.h" |
19 | 19 |
| 20 #if defined(OS_CHROMEOS) |
| 21 #include "chromeos/audio/cras_audio_handler.h" |
| 22 #endif |
| 23 |
20 namespace content { | 24 namespace content { |
21 | 25 |
22 PPAPITestMessageHandler::PPAPITestMessageHandler() { | 26 PPAPITestMessageHandler::PPAPITestMessageHandler() { |
23 } | 27 } |
24 | 28 |
25 TestMessageHandler::MessageResponse PPAPITestMessageHandler::HandleMessage( | 29 TestMessageHandler::MessageResponse PPAPITestMessageHandler::HandleMessage( |
26 const std::string& json) { | 30 const std::string& json) { |
27 std::string trimmed; | 31 std::string trimmed; |
28 base::TrimString(json, "\"", &trimmed); | 32 base::TrimString(json, "\"", &trimmed); |
29 if (trimmed == "...") | 33 if (trimmed == "...") |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 | 126 |
123 std::string PPAPITest::BuildQuery(const std::string& base, | 127 std::string PPAPITest::BuildQuery(const std::string& base, |
124 const std::string& test_case){ | 128 const std::string& test_case){ |
125 return base::StringPrintf("%stestcase=%s", base.c_str(), test_case.c_str()); | 129 return base::StringPrintf("%stestcase=%s", base.c_str(), test_case.c_str()); |
126 } | 130 } |
127 | 131 |
128 OutOfProcessPPAPITest::OutOfProcessPPAPITest() { | 132 OutOfProcessPPAPITest::OutOfProcessPPAPITest() { |
129 in_process_ = false; | 133 in_process_ = false; |
130 } | 134 } |
131 | 135 |
| 136 void OutOfProcessPPAPITest::SetUp() { |
| 137 #if defined(OS_CHROMEOS) |
| 138 chromeos::CrasAudioHandler::InitializeForTesting(); |
| 139 #endif |
| 140 ContentBrowserTest::SetUp(); |
| 141 } |
| 142 |
| 143 void OutOfProcessPPAPITest::TearDown() { |
| 144 ContentBrowserTest::TearDown(); |
| 145 #if defined(OS_CHROMEOS) |
| 146 chromeos::CrasAudioHandler::Shutdown(); |
| 147 #endif |
| 148 } |
| 149 |
132 } // namespace content | 150 } // namespace content |
OLD | NEW |