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/browser/extensions/user_script_listener_unittest.cc

Issue 7624031: Treat files downloaded from the address bar as "always safe" (including extensions per discussion... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 3 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
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_webnavigation_api.cc ('k') | chrome/browser/metrics/metrics_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698