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