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/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 "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/chrome_notification_types.h" | 15 #include "chrome/browser/chrome_notification_types.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/confirm_infobar_delegate.h" | 17 #include "chrome/browser/infobars/confirm_infobar_delegate.h" |
18 #include "chrome/browser/infobars/infobar.h" | 18 #include "chrome/browser/infobars/infobar.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/browser/ui/tabs/tab_strip_model.h" | 22 #include "chrome/browser/ui/tabs/tab_strip_model.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" | |
26 #include "chrome/test/base/ui_test_utils.h" | 25 #include "chrome/test/base/ui_test_utils.h" |
27 #include "content/public/browser/dom_operation_notification_details.h" | 26 #include "content/public/browser/dom_operation_notification_details.h" |
28 #include "content/public/browser/notification_service.h" | 27 #include "content/public/browser/notification_service.h" |
29 #include "content/public/browser/notification_types.h" | 28 #include "content/public/browser/notification_types.h" |
30 #include "content/public/browser/web_contents.h" | 29 #include "content/public/browser/web_contents.h" |
31 #include "content/public/common/content_paths.h" | 30 #include "content/public/common/content_paths.h" |
32 #include "content/public/common/content_switches.h" | 31 #include "content/public/common/content_switches.h" |
33 #include "content/public/test/browser_test_utils.h" | 32 #include "content/public/test/browser_test_utils.h" |
34 #include "content/public/test/test_renderer_host.h" | 33 #include "content/public/test/test_renderer_host.h" |
35 #include "net/base/net_util.h" | 34 #include "net/base/net_util.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 | 108 |
110 void PPAPITestBase::InfoBarObserver::ExpectInfoBarAndAccept( | 109 void PPAPITestBase::InfoBarObserver::ExpectInfoBarAndAccept( |
111 bool should_accept) { | 110 bool should_accept) { |
112 expected_infobars_.push_back(should_accept); | 111 expected_infobars_.push_back(should_accept); |
113 } | 112 } |
114 | 113 |
115 PPAPITestBase::PPAPITestBase() { | 114 PPAPITestBase::PPAPITestBase() { |
116 } | 115 } |
117 | 116 |
118 void PPAPITestBase::SetUpCommandLine(CommandLine* command_line) { | 117 void PPAPITestBase::SetUpCommandLine(CommandLine* command_line) { |
119 // Do not use mesa if real GPU is required. | |
120 if (!command_line->HasSwitch(switches::kUseGpuInTests)) { | |
121 #if !defined(OS_MACOSX) | |
122 CHECK(test_launcher_utils::OverrideGLImplementation( | |
123 command_line, gfx::kGLImplementationOSMesaName)) << | |
124 "kUseGL must not be set by test framework code!"; | |
125 #endif | |
126 } | |
127 | |
128 // The test sends us the result via a cookie. | 118 // The test sends us the result via a cookie. |
129 command_line->AppendSwitch(switches::kEnableFileCookies); | 119 command_line->AppendSwitch(switches::kEnableFileCookies); |
130 | 120 |
131 // Some stuff is hung off of the testing interface which is not enabled | 121 // Some stuff is hung off of the testing interface which is not enabled |
132 // by default. | 122 // by default. |
133 command_line->AppendSwitch(switches::kEnablePepperTesting); | 123 command_line->AppendSwitch(switches::kEnablePepperTesting); |
134 | 124 |
135 // Smooth scrolling confuses the scrollbar test. | 125 // Smooth scrolling confuses the scrollbar test. |
136 command_line->AppendSwitch(switches::kDisableSmoothScrolling); | 126 command_line->AppendSwitch(switches::kDisableSmoothScrolling); |
137 | 127 |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 const std::string& base, | 373 const std::string& base, |
384 const std::string& test_case) { | 374 const std::string& test_case) { |
385 return base::StringPrintf("%smode=nacl_newlib&testcase=%s", base.c_str(), | 375 return base::StringPrintf("%smode=nacl_newlib&testcase=%s", base.c_str(), |
386 test_case.c_str()); | 376 test_case.c_str()); |
387 } | 377 } |
388 | 378 |
389 void PPAPIBrokerInfoBarTest::SetUpOnMainThread() { | 379 void PPAPIBrokerInfoBarTest::SetUpOnMainThread() { |
390 // The default content setting for the PPAPI broker is ASK. We purposefully | 380 // The default content setting for the PPAPI broker is ASK. We purposefully |
391 // don't call PPAPITestBase::SetUpOnMainThread() to keep it that way. | 381 // don't call PPAPITestBase::SetUpOnMainThread() to keep it that way. |
392 } | 382 } |
OLD | NEW |