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 "chrome/test/ppapi/ppapi_test.h" | 5 #include "chrome/test/ppapi/ppapi_test.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
11 #include "base/stringprintf.h" | 11 #include "base/stringprintf.h" |
12 #include "base/string_util.h" | 12 #include "base/string_util.h" |
13 #include "base/test/test_timeouts.h" | 13 #include "base/test/test_timeouts.h" |
14 #include "build/build_config.h" | 14 #include "build/build_config.h" |
15 #include "chrome/browser/api/infobars/confirm_infobar_delegate.h" | 15 #include "chrome/browser/api/infobars/confirm_infobar_delegate.h" |
16 #include "chrome/browser/content_settings/host_content_settings_map.h" | 16 #include "chrome/browser/content_settings/host_content_settings_map.h" |
17 #include "chrome/browser/infobars/infobar.h" | 17 #include "chrome/browser/infobars/infobar.h" |
18 #include "chrome/browser/infobars/infobar_tab_helper.h" | 18 #include "chrome/browser/infobars/infobar_tab_helper.h" |
19 #include "chrome/browser/profiles/profile.h" | 19 #include "chrome/browser/profiles/profile.h" |
20 #include "chrome/browser/ui/browser.h" | 20 #include "chrome/browser/ui/browser.h" |
21 #include "chrome/browser/ui/browser_tabstrip.h" | 21 #include "chrome/browser/ui/browser_tabstrip.h" |
22 #include "chrome/common/chrome_notification_types.h" | 22 #include "chrome/common/chrome_notification_types.h" |
23 #include "chrome/common/chrome_paths.h" | 23 #include "chrome/common/chrome_paths.h" |
24 #include "chrome/common/chrome_switches.h" | 24 #include "chrome/common/chrome_switches.h" |
25 #include "chrome/test/base/test_launcher_utils.h" | 25 #include "chrome/test/base/test_launcher_utils.h" |
26 #include "chrome/test/base/ui_test_utils.h" | 26 #include "chrome/test/base/ui_test_utils.h" |
27 #include "content/public/browser/dom_operation_notification_details.h" | 27 #include "content/public/browser/dom_operation_notification_details.h" |
28 #include "content/public/test/test_renderer_host.h" | |
29 #include "content/public/browser/notification_service.h" | 28 #include "content/public/browser/notification_service.h" |
30 #include "content/public/browser/notification_types.h" | 29 #include "content/public/browser/notification_types.h" |
31 #include "content/public/browser/web_contents.h" | 30 #include "content/public/browser/web_contents.h" |
32 #include "content/public/common/content_paths.h" | 31 #include "content/public/common/content_paths.h" |
33 #include "content/public/common/content_switches.h" | 32 #include "content/public/common/content_switches.h" |
34 #include "content/public/test/browser_test_utils.h" | 33 #include "content/public/test/browser_test_utils.h" |
| 34 #include "content/public/test/test_launcher_utils.h" |
| 35 #include "content/public/test/test_renderer_host.h" |
35 #include "content/test/gpu/test_switches.h" | 36 #include "content/test/gpu/test_switches.h" |
36 #include "media/audio/audio_manager.h" | 37 #include "media/audio/audio_manager.h" |
37 #include "net/base/net_util.h" | 38 #include "net/base/net_util.h" |
38 #include "net/test/test_server.h" | 39 #include "net/test/test_server.h" |
39 #include "ui/gl/gl_switches.h" | 40 #include "ui/gl/gl_switches.h" |
40 #include "webkit/plugins/plugin_switches.h" | 41 #include "webkit/plugins/plugin_switches.h" |
41 | 42 |
42 using content::DomOperationNotificationDetails; | 43 using content::DomOperationNotificationDetails; |
43 using content::RenderViewHost; | 44 using content::RenderViewHost; |
44 | 45 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 expected_infobars_.push_back(should_accept); | 116 expected_infobars_.push_back(should_accept); |
116 } | 117 } |
117 | 118 |
118 PPAPITestBase::PPAPITestBase() { | 119 PPAPITestBase::PPAPITestBase() { |
119 } | 120 } |
120 | 121 |
121 void PPAPITestBase::SetUpCommandLine(CommandLine* command_line) { | 122 void PPAPITestBase::SetUpCommandLine(CommandLine* command_line) { |
122 // Do not use mesa if real GPU is required. | 123 // Do not use mesa if real GPU is required. |
123 if (!command_line->HasSwitch(switches::kUseGpuInTests)) { | 124 if (!command_line->HasSwitch(switches::kUseGpuInTests)) { |
124 #if !defined(OS_MACOSX) | 125 #if !defined(OS_MACOSX) |
125 CHECK(test_launcher_utils::OverrideGLImplementation( | 126 CHECK(content::OverrideGLImplementation( |
126 command_line, gfx::kGLImplementationOSMesaName)) << | 127 command_line, gfx::kGLImplementationOSMesaName)) << |
127 "kUseGL must not be set by test framework code!"; | 128 "kUseGL must not be set by test framework code!"; |
128 #endif | 129 #endif |
129 } | 130 } |
130 | 131 |
131 // The test sends us the result via a cookie. | 132 // The test sends us the result via a cookie. |
132 command_line->AppendSwitch(switches::kEnableFileCookies); | 133 command_line->AppendSwitch(switches::kEnableFileCookies); |
133 | 134 |
134 // Some stuff is hung off of the testing interface which is not enabled | 135 // Some stuff is hung off of the testing interface which is not enabled |
135 // by default. | 136 // by default. |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 const std::string& base, | 348 const std::string& base, |
348 const std::string& test_case) { | 349 const std::string& test_case) { |
349 return StringPrintf("%smode=nacl_newlib&testcase=%s", base.c_str(), | 350 return StringPrintf("%smode=nacl_newlib&testcase=%s", base.c_str(), |
350 test_case.c_str()); | 351 test_case.c_str()); |
351 } | 352 } |
352 | 353 |
353 void PPAPIBrokerInfoBarTest::SetUpOnMainThread() { | 354 void PPAPIBrokerInfoBarTest::SetUpOnMainThread() { |
354 // The default content setting for the PPAPI broker is ASK. We purposefully | 355 // The default content setting for the PPAPI broker is ASK. We purposefully |
355 // don't call PPAPITestBase::SetUpOnMainThread() to keep it that way. | 356 // don't call PPAPITestBase::SetUpOnMainThread() to keep it that way. |
356 } | 357 } |
OLD | NEW |