Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(175)

Side by Side Diff: chrome/test/ui/ppapi_uitest.cc

Issue 3034038: GTTF: Move more test server code from net/url_request/url_request_unittest.h (Closed)
Patch Set: hopefully final Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/test/live_sync/live_sync_test.cc ('k') | chrome/worker/worker_uitest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/test/live_sync/live_sync_test.cc ('k') | chrome/worker/worker_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698