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

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

Issue 173049: Revert r23616 from 172. (Closed) Base URL: svn://chrome-svn.corp.google.com/chrome/branches/172/src/
Patch Set: Created 11 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
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 23 matching lines...) Expand all
34 34
35 // Loads/unloads the chrome test plugin. 35 // Loads/unloads the chrome test plugin.
36 void LoadPlugin(); 36 void LoadPlugin();
37 void UnloadPlugin(); 37 void UnloadPlugin();
38 38
39 // Runs the test and expects the given payload as a response. If expectation 39 // Runs the test and expects the given payload as a response. If expectation
40 // is NULL, the request is expected to fail. 40 // is NULL, the request is expected to fail.
41 void RunTest(const GURL& url, const TestResponsePayload* expected_payload); 41 void RunTest(const GURL& url, const TestResponsePayload* expected_payload);
42 42
43 // URLRequest::Delegate implementations 43 // URLRequest::Delegate implementations
44 virtual void OnReceivedRedirect(URLRequest* request,
45 const GURL& new_url) { }
44 virtual void OnResponseStarted(URLRequest* request); 46 virtual void OnResponseStarted(URLRequest* request);
45 virtual void OnReadCompleted(URLRequest* request, int bytes_read); 47 virtual void OnReadCompleted(URLRequest* request, int bytes_read);
46 48
47 // Helper called when the URLRequest is done. 49 // Helper called when the URLRequest is done.
48 void OnURLRequestComplete(); 50 void OnURLRequestComplete();
49 51
50 // testing::Test 52 // testing::Test
51 virtual void SetUp() { 53 virtual void SetUp() {
52 LoadPlugin(); 54 LoadPlugin();
53 URLRequest::RegisterProtocolFactory("test", &URLRequestTestJob::Factory); 55 URLRequest::RegisterProtocolFactory("test", &URLRequestTestJob::Factory);
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 278
277 // Tests that the plugin does not intercept its own requests. 279 // Tests that the plugin does not intercept its own requests.
278 TEST_F(ChromePluginTest, DoesNotInterceptOwnRequest) { 280 TEST_F(ChromePluginTest, DoesNotInterceptOwnRequest) {
279 const TestResponsePayload& payload = kChromeTestPluginPayloads[0]; 281 const TestResponsePayload& payload = kChromeTestPluginPayloads[0];
280 282
281 EXPECT_EQ(CPERR_SUCCESS, test_funcs_.test_make_request( 283 EXPECT_EQ(CPERR_SUCCESS, test_funcs_.test_make_request(
282 "GET", GURL(payload.url))); 284 "GET", GURL(payload.url)));
283 285
284 MessageLoop::current()->Run(); 286 MessageLoop::current()->Run();
285 } 287 }
OLDNEW
« no previous file with comments | « chrome/browser/renderer_host/resource_dispatcher_host.cc ('k') | net/proxy/proxy_script_fetcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698