OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/message_loop.h" | 5 #include "base/message_loop.h" |
6 #include "base/threading/thread.h" | 6 #include "base/threading/thread.h" |
7 #include "chrome/browser/extensions/extension_service_unittest.h" | 7 #include "chrome/browser/extensions/extension_service_unittest.h" |
8 #include "chrome/browser/extensions/user_script_listener.h" | 8 #include "chrome/browser/extensions/user_script_listener.h" |
9 #include "chrome/common/chrome_notification_types.h" | 9 #include "chrome/common/chrome_notification_types.h" |
10 #include "chrome/common/chrome_paths.h" | 10 #include "chrome/common/chrome_paths.h" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 virtual void OnRequestClosed() { | 83 virtual void OnRequestClosed() { |
84 } | 84 } |
85 | 85 |
86 private: | 86 private: |
87 DISALLOW_COPY_AND_ASSIGN(DummyResourceHandler); | 87 DISALLOW_COPY_AND_ASSIGN(DummyResourceHandler); |
88 }; | 88 }; |
89 | 89 |
90 ResourceDispatcherHostRequestInfo* CreateRequestInfo(int request_id) { | 90 ResourceDispatcherHostRequestInfo* CreateRequestInfo(int request_id) { |
91 return new ResourceDispatcherHostRequestInfo( | 91 return new ResourceDispatcherHostRequestInfo( |
92 new DummyResourceHandler(), ChildProcessInfo::RENDER_PROCESS, 0, 0, 0, | 92 new DummyResourceHandler(), ChildProcessInfo::RENDER_PROCESS, 0, 0, 0, |
93 request_id, false, -1, ResourceType::MAIN_FRAME, 0, false, false, false, | 93 request_id, false, -1, ResourceType::MAIN_FRAME, PageTransition::LINK, 0, |
94 content::MockResourceContext::GetInstance()); | 94 false, false, false, content::MockResourceContext::GetInstance()); |
95 } | 95 } |
96 | 96 |
97 // A simple test net::URLRequestJob. We don't care what it does, only that | 97 // A simple test net::URLRequestJob. We don't care what it does, only that |
98 // whether it starts and finishes. | 98 // whether it starts and finishes. |
99 class SimpleTestJob : public net::URLRequestTestJob { | 99 class SimpleTestJob : public net::URLRequestTestJob { |
100 public: | 100 public: |
101 explicit SimpleTestJob(net::URLRequest* request) | 101 explicit SimpleTestJob(net::URLRequest* request) |
102 : net::URLRequestTestJob(request, test_headers(), kTestData, true) {} | 102 : net::URLRequestTestJob(request, test_headers(), kTestData, true) {} |
103 private: | 103 private: |
104 ~SimpleTestJob() {} | 104 ~SimpleTestJob() {} |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 kNotMatchingUrl)); | 238 kNotMatchingUrl)); |
239 | 239 |
240 // The request should be started immediately. | 240 // The request should be started immediately. |
241 ASSERT_TRUE(request->is_pending()); | 241 ASSERT_TRUE(request->is_pending()); |
242 | 242 |
243 MessageLoop::current()->RunAllPending(); | 243 MessageLoop::current()->RunAllPending(); |
244 EXPECT_EQ(kTestData, delegate.data_received()); | 244 EXPECT_EQ(kTestData, delegate.data_received()); |
245 } | 245 } |
246 | 246 |
247 } // namespace | 247 } // namespace |
OLD | NEW |