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

Side by Side Diff: chrome/browser/extensions/api/web_request/web_request_permissions_unittest.cc

Issue 1086733002: Ensure tests have an active task runner (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 5 years, 7 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "extensions/browser/api/web_request/web_request_permissions.h" 5 #include "extensions/browser/api/web_request/web_request_permissions.h"
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "chrome/common/extensions/extension_test_util.h" 9 #include "chrome/common/extensions/extension_test_util.h"
10 #include "content/public/browser/resource_request_info.h" 10 #include "content/public/browser/resource_request_info.h"
(...skipping 13 matching lines...) Expand all
24 using extension_test_util::LoadManifestUnchecked; 24 using extension_test_util::LoadManifestUnchecked;
25 25
26 class ExtensionWebRequestHelpersTestWithThreadsTest : public testing::Test { 26 class ExtensionWebRequestHelpersTestWithThreadsTest : public testing::Test {
27 public: 27 public:
28 ExtensionWebRequestHelpersTestWithThreadsTest() 28 ExtensionWebRequestHelpersTestWithThreadsTest()
29 : thread_bundle_(content::TestBrowserThreadBundle::IO_MAINLOOP) {} 29 : thread_bundle_(content::TestBrowserThreadBundle::IO_MAINLOOP) {}
30 30
31 protected: 31 protected:
32 void SetUp() override; 32 void SetUp() override;
33 33
34 private:
35 content::TestBrowserThreadBundle thread_bundle_;
36
34 protected: 37 protected:
35 net::TestURLRequestContext context; 38 net::TestURLRequestContext context;
36 39
37 // This extension has Web Request permissions, but no host permission. 40 // This extension has Web Request permissions, but no host permission.
38 scoped_refptr<Extension> permissionless_extension_; 41 scoped_refptr<Extension> permissionless_extension_;
39 // This extension has Web Request permissions, and *.com a host permission. 42 // This extension has Web Request permissions, and *.com a host permission.
40 scoped_refptr<Extension> com_extension_; 43 scoped_refptr<Extension> com_extension_;
41 scoped_refptr<extensions::InfoMap> extension_info_map_; 44 scoped_refptr<extensions::InfoMap> extension_info_map_;
42
43 private:
44 content::TestBrowserThreadBundle thread_bundle_;
45 }; 45 };
46 46
47 void ExtensionWebRequestHelpersTestWithThreadsTest::SetUp() { 47 void ExtensionWebRequestHelpersTestWithThreadsTest::SetUp() {
48 testing::Test::SetUp(); 48 testing::Test::SetUp();
49 49
50 std::string error; 50 std::string error;
51 permissionless_extension_ = LoadManifestUnchecked("permissions", 51 permissionless_extension_ = LoadManifestUnchecked("permissions",
52 "web_request_no_host.json", 52 "web_request_no_host.json",
53 Manifest::INVALID_LOCATION, 53 Manifest::INVALID_LOCATION,
54 Extension::NO_FLAGS, 54 Extension::NO_FLAGS,
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 request->url(), 168 request->url(),
169 false /*crosses_incognito*/, 169 false /*crosses_incognito*/,
170 WebRequestPermissions::REQUIRE_HOST_PERMISSION)); 170 WebRequestPermissions::REQUIRE_HOST_PERMISSION));
171 EXPECT_FALSE(WebRequestPermissions::CanExtensionAccessURL( 171 EXPECT_FALSE(WebRequestPermissions::CanExtensionAccessURL(
172 extension_info_map_.get(), 172 extension_info_map_.get(),
173 com_extension_->id(), 173 com_extension_->id(),
174 request->url(), 174 request->url(),
175 false /*crosses_incognito*/, 175 false /*crosses_incognito*/,
176 WebRequestPermissions::REQUIRE_ALL_URLS)); 176 WebRequestPermissions::REQUIRE_ALL_URLS));
177 } 177 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698