| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/file_path.h" | 5 #include "base/file_path.h" |
| 6 |
| 7 #include "app/app_switches.h" |
| 6 #include "chrome/common/chrome_switches.h" | 8 #include "chrome/common/chrome_switches.h" |
| 7 #include "chrome/test/ui/npapi_test_helper.h" | 9 #include "chrome/test/ui/npapi_test_helper.h" |
| 8 #include "chrome/test/ui_test_utils.h" | 10 #include "chrome/test/ui_test_utils.h" |
| 9 | 11 |
| 10 #if defined(OS_WIN) | 12 #if defined(OS_WIN) |
| 11 static const char kPepperTestPluginName[] = "npapi_pepper_test_plugin.dll"; | 13 static const char kPepperTestPluginName[] = "npapi_pepper_test_plugin.dll"; |
| 12 #elif defined(OS_MACOSX) | 14 #elif defined(OS_MACOSX) |
| 13 static const char kPepperTestPluginName[] = "npapi_pepper_test_plugin.plugin"; | 15 static const char kPepperTestPluginName[] = "npapi_pepper_test_plugin.plugin"; |
| 14 #elif defined(OS_LINUX) | 16 #elif defined(OS_LINUX) |
| 15 static const char kPepperTestPluginName[] = "libnpapi_pepper_test_plugin.so"; | 17 static const char kPepperTestPluginName[] = "libnpapi_pepper_test_plugin.so"; |
| 16 #endif | 18 #endif |
| 17 | 19 |
| 18 using npapi_test::kTestCompleteCookie; | 20 using npapi_test::kTestCompleteCookie; |
| 19 using npapi_test::kTestCompleteSuccess; | 21 using npapi_test::kTestCompleteSuccess; |
| 20 | 22 |
| 21 // Helper class pepper NPAPI tests. | 23 // Helper class pepper NPAPI tests. |
| 22 class PepperTester : public NPAPITesterBase { | 24 class PepperTester : public NPAPITesterBase { |
| 23 protected: | 25 protected: |
| 24 PepperTester() : NPAPITesterBase(kPepperTestPluginName) {} | 26 PepperTester() : NPAPITesterBase(kPepperTestPluginName) {} |
| 25 | 27 |
| 26 virtual void SetUp() { | 28 virtual void SetUp() { |
| 27 // TODO(alokp): Remove no-sandbox flag once gpu plugin can run in sandbox. | 29 // TODO(alokp): Remove no-sandbox flag once gpu plugin can run in sandbox. |
| 28 launch_arguments_.AppendSwitch(switches::kNoSandbox); | 30 launch_arguments_.AppendSwitch(switches::kNoSandbox); |
| 29 launch_arguments_.AppendSwitch(switches::kInternalPepper); | 31 launch_arguments_.AppendSwitch(switches::kInternalPepper); |
| 30 launch_arguments_.AppendSwitch(switches::kEnableGPUPlugin); | 32 launch_arguments_.AppendSwitch(switches::kEnableGPUPlugin); |
| 33 // Use Mesa software renderer so it can run on testbots without any |
| 34 // graphics hardware. |
| 35 launch_arguments_.AppendSwitchWithValue(switches::kUseGL, "osmesa"); |
| 31 NPAPITesterBase::SetUp(); | 36 NPAPITesterBase::SetUp(); |
| 32 } | 37 } |
| 33 }; | 38 }; |
| 34 | 39 |
| 35 // Test that a pepper 3d plugin loads and renders. | 40 // Test that a pepper 3d plugin loads and renders. |
| 36 // TODO(alokp): Enable the test after making sure it works on all platforms | 41 // TODO(alokp): Enable the test after making sure it works on all platforms |
| 37 // and buildbots have OpenGL support. | 42 // and buildbots have OpenGL support. |
| 38 #if defined(OS_WIN) | 43 #if defined(OS_WIN) |
| 39 // Disabled after failing on buildbots: crbug/46662 | 44 TEST_F(PepperTester, Pepper3D) { |
| 40 TEST_F(PepperTester, DISABLED_Pepper3D) { | |
| 41 const FilePath dir(FILE_PATH_LITERAL("pepper")); | 45 const FilePath dir(FILE_PATH_LITERAL("pepper")); |
| 42 const FilePath file(FILE_PATH_LITERAL("pepper_3d.html")); | 46 const FilePath file(FILE_PATH_LITERAL("pepper_3d.html")); |
| 43 GURL url = ui_test_utils::GetTestUrl(dir, file); | 47 GURL url = ui_test_utils::GetTestUrl(dir, file); |
| 44 ASSERT_NO_FATAL_FAILURE(NavigateToURL(url)); | 48 ASSERT_NO_FATAL_FAILURE(NavigateToURL(url)); |
| 45 WaitForFinish("pepper_3d", "1", url, | 49 WaitForFinish("pepper_3d", "1", url, |
| 46 kTestCompleteCookie, kTestCompleteSuccess, | 50 kTestCompleteCookie, kTestCompleteSuccess, |
| 47 action_max_timeout_ms()); | 51 action_max_timeout_ms()); |
| 48 } | 52 } |
| 49 #endif | 53 #endif |
| OLD | NEW |