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_util.h" | 5 #include "base/file_util.h" |
6 #include "base/path_service.h" | 6 #include "base/path_service.h" |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 #include "chrome/common/chrome_switches.h" | 8 #include "chrome/common/chrome_switches.h" |
9 #include "chrome/test/automation/tab_proxy.h" | 9 #include "chrome/test/automation/tab_proxy.h" |
10 #include "chrome/test/ui/ui_test.h" | 10 #include "chrome/test/ui/ui_test.h" |
11 #include "net/base/net_util.h" | 11 #include "net/base/net_util.h" |
12 #include "net/url_request/url_request_unittest.h" | 12 #include "net/test/test_server.h" |
13 #include "webkit/glue/plugins/plugin_switches.h" | 13 #include "webkit/glue/plugins/plugin_switches.h" |
14 | 14 |
15 namespace { | 15 namespace { |
16 | 16 |
17 // Platform-specific filename relative to the chrome executable. | 17 // Platform-specific filename relative to the chrome executable. |
18 #if defined(OS_WIN) | 18 #if defined(OS_WIN) |
19 const wchar_t library_name[] = L"ppapi_tests.dll"; | 19 const wchar_t library_name[] = L"ppapi_tests.dll"; |
20 #elif defined(OS_MACOSX) | 20 #elif defined(OS_MACOSX) |
21 const char library_name[] = "ppapi_tests.plugin"; | 21 const char library_name[] = "ppapi_tests.plugin"; |
22 #elif defined(OS_POSIX) | 22 #elif defined(OS_POSIX) |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 | 67 |
68 GURL::Replacements replacements; | 68 GURL::Replacements replacements; |
69 replacements.SetQuery(test_case.c_str(), | 69 replacements.SetQuery(test_case.c_str(), |
70 url_parse::Component(0, test_case.size())); | 70 url_parse::Component(0, test_case.size())); |
71 GURL test_url = net::FilePathToFileURL(test_path); | 71 GURL test_url = net::FilePathToFileURL(test_path); |
72 RunTestURL(test_url.ReplaceComponents(replacements)); | 72 RunTestURL(test_url.ReplaceComponents(replacements)); |
73 } | 73 } |
74 | 74 |
75 void RunTestViaHTTP(const std::string& test_case) { | 75 void RunTestViaHTTP(const std::string& test_case) { |
76 const wchar_t kDocRoot[] = L"third_party/ppapi/tests"; | 76 const wchar_t kDocRoot[] = L"third_party/ppapi/tests"; |
77 scoped_refptr<HTTPTestServer> server( | 77 scoped_refptr<net::HTTPTestServer> server( |
78 HTTPTestServer::CreateServer(kDocRoot)); | 78 net::HTTPTestServer::CreateServer(kDocRoot)); |
79 ASSERT_TRUE(server); | 79 ASSERT_TRUE(server); |
80 RunTestURL(server->TestServerPage("files/test_case.html?" + test_case)); | 80 RunTestURL(server->TestServerPage("files/test_case.html?" + test_case)); |
81 } | 81 } |
82 | 82 |
83 private: | 83 private: |
84 void RunTestURL(const GURL& test_url) { | 84 void RunTestURL(const GURL& test_url) { |
85 scoped_refptr<TabProxy> tab(GetActiveTab()); | 85 scoped_refptr<TabProxy> tab(GetActiveTab()); |
86 ASSERT_TRUE(tab.get()); | 86 ASSERT_TRUE(tab.get()); |
87 ASSERT_TRUE(tab->NavigateToURL(test_url)); | 87 ASSERT_TRUE(tab->NavigateToURL(test_url)); |
88 std::string escaped_value = | 88 std::string escaped_value = |
(...skipping 24 matching lines...) Expand all Loading... |
113 } | 113 } |
114 | 114 |
115 #if defined(OS_LINUX) | 115 #if defined(OS_LINUX) |
116 // Flaky, http://crbug.com/48544. | 116 // Flaky, http://crbug.com/48544. |
117 TEST_F(PPAPITest, FLAKY_Scrollbar) { | 117 TEST_F(PPAPITest, FLAKY_Scrollbar) { |
118 #else | 118 #else |
119 TEST_F(PPAPITest, Scrollbar) { | 119 TEST_F(PPAPITest, Scrollbar) { |
120 #endif | 120 #endif |
121 RunTest("Scrollbar"); | 121 RunTest("Scrollbar"); |
122 } | 122 } |
OLD | NEW |