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

Side by Side Diff: chrome/common/chrome_plugin_unittest.cc

Issue 16490: Add FTP unit test in preparation for portable FTP implementation.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/views/find_bar_win_uitest.cc ('k') | chrome/common/net/cache_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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 // Tests exercising the Chrome Plugin API. 4 // Tests exercising the Chrome Plugin API.
5 5
6 #include "base/file_util.h" 6 #include "base/file_util.h"
7 #include "base/path_service.h" 7 #include "base/path_service.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "chrome/browser/chrome_plugin_host.h" 9 #include "chrome/browser/chrome_plugin_host.h"
10 #include "chrome/browser/profile.h" 10 #include "chrome/browser/profile.h"
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 251
252 // Note: we must add this task after we make the request, so that 252 // Note: we must add this task after we make the request, so that
253 // URLRequestTestJob's StartAsync task is added and run first. 253 // URLRequestTestJob's StartAsync task is added and run first.
254 MessageLoop::current()->PostTask(FROM_HERE, 254 MessageLoop::current()->PostTask(FROM_HERE,
255 NewRunnableFunction(&ProcessAllPendingMessages)); 255 NewRunnableFunction(&ProcessAllPendingMessages));
256 MessageLoop::current()->Run(); 256 MessageLoop::current()->Run();
257 } 257 }
258 258
259 // Tests that the plugin can issue a POST request. 259 // Tests that the plugin can issue a POST request.
260 TEST_F(ChromePluginTest, CanMakePOSTRequest) { 260 TEST_F(ChromePluginTest, CanMakePOSTRequest) {
261 TestServer server(kDocRoot); 261 scoped_refptr<HTTPTestServer> server =
262 GURL url = server.TestServerPage("echo"); 262 HTTPTestServer::CreateServer(kDocRoot);
263 ASSERT_TRUE(NULL != server.get());
264
265 GURL url = server->TestServerPage("echo");
263 266
264 EXPECT_EQ(CPERR_SUCCESS, test_funcs_.test_make_request("POST", url)); 267 EXPECT_EQ(CPERR_SUCCESS, test_funcs_.test_make_request("POST", url));
265 268
266 // Note: we must add this task after we make the request, so that 269 // Note: we must add this task after we make the request, so that
267 // URLRequestTestJob's StartAsync task is added and run first. 270 // URLRequestTestJob's StartAsync task is added and run first.
268 MessageLoop::current()->PostTask(FROM_HERE, 271 MessageLoop::current()->PostTask(FROM_HERE,
269 NewRunnableFunction(&ProcessAllPendingMessages)); 272 NewRunnableFunction(&ProcessAllPendingMessages));
270 MessageLoop::current()->Run(); 273 MessageLoop::current()->Run();
271 } 274 }
272 275
273 // Tests that the plugin does not intercept its own requests. 276 // Tests that the plugin does not intercept its own requests.
274 TEST_F(ChromePluginTest, DoesNotInterceptOwnRequest) { 277 TEST_F(ChromePluginTest, DoesNotInterceptOwnRequest) {
275 const TestResponsePayload& payload = kChromeTestPluginPayloads[0]; 278 const TestResponsePayload& payload = kChromeTestPluginPayloads[0];
276 279
277 EXPECT_EQ(CPERR_SUCCESS, test_funcs_.test_make_request( 280 EXPECT_EQ(CPERR_SUCCESS, test_funcs_.test_make_request(
278 "GET", GURL(payload.url))); 281 "GET", GURL(payload.url)));
279 282
280 MessageLoop::current()->Run(); 283 MessageLoop::current()->Run();
281 } 284 }
282 285
OLDNEW
« no previous file with comments | « chrome/browser/views/find_bar_win_uitest.cc ('k') | chrome/common/net/cache_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698