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

Side by Side Diff: chrome/browser/extensions/active_script_controller_unittest.cc

Issue 508513002: Remove implicit conversions from scoped_refptr to T* in chrome/browser/extensions/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Two more Created 6 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <map> 5 #include <map>
6 6
7 #include "base/values.h" 7 #include "base/values.h"
8 #include "chrome/browser/extensions/active_script_controller.h" 8 #include "chrome/browser/extensions/active_script_controller.h"
9 #include "chrome/browser/extensions/active_tab_permission_granter.h" 9 #include "chrome/browser/extensions/active_tab_permission_granter.h"
10 #include "chrome/browser/extensions/extension_util.h" 10 #include "chrome/browser/extensions/extension_util.h"
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 .Set("description", "an extension") 103 .Set("description", "an extension")
104 .Set("manifest_version", 2) 104 .Set("manifest_version", 2)
105 .Set("version", "1.0.0") 105 .Set("version", "1.0.0")
106 .Set("permissions", 106 .Set("permissions",
107 ListBuilder().Append(kAllHostsPermission))) 107 ListBuilder().Append(kAllHostsPermission)))
108 .SetLocation(Manifest::INTERNAL) 108 .SetLocation(Manifest::INTERNAL)
109 .SetID(kId) 109 .SetID(kId)
110 .Build(); 110 .Build();
111 111
112 ExtensionRegistry::Get(profile())->AddEnabled(extension_); 112 ExtensionRegistry::Get(profile())->AddEnabled(extension_);
113 PermissionsUpdater(profile()).InitializePermissions(extension_); 113 PermissionsUpdater(profile()).InitializePermissions(extension_.get());
114 return extension_; 114 return extension_.get();
115 } 115 }
116 116
117 const Extension* ActiveScriptControllerUnitTest::ReloadExtension() { 117 const Extension* ActiveScriptControllerUnitTest::ReloadExtension() {
118 ExtensionRegistry::Get(profile())->RemoveEnabled(extension_->id()); 118 ExtensionRegistry::Get(profile())->RemoveEnabled(extension_->id());
119 return AddExtension(); 119 return AddExtension();
120 } 120 }
121 121
122 bool ActiveScriptControllerUnitTest::RequiresUserConsent( 122 bool ActiveScriptControllerUnitTest::RequiresUserConsent(
123 const Extension* extension) const { 123 const Extension* extension) const {
124 PermissionsData::AccessType access_type = 124 PermissionsData::AccessType access_type =
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
402 EXPECT_TRUE(RequiresUserConsent(extension)); 402 EXPECT_TRUE(RequiresUserConsent(extension));
403 // Different subdomain... 403 // Different subdomain...
404 NavigateAndCommit(GURL("https://en.google.com/foo/bar")); 404 NavigateAndCommit(GURL("https://en.google.com/foo/bar"));
405 EXPECT_TRUE(RequiresUserConsent(extension)); 405 EXPECT_TRUE(RequiresUserConsent(extension));
406 // Only the "always run" origin should be allowed to run without user consent. 406 // Only the "always run" origin should be allowed to run without user consent.
407 NavigateAndCommit(GURL("https://www.google.com/foo/bar")); 407 NavigateAndCommit(GURL("https://www.google.com/foo/bar"));
408 EXPECT_FALSE(RequiresUserConsent(extension)); 408 EXPECT_FALSE(RequiresUserConsent(extension));
409 } 409 }
410 410
411 } // namespace extensions 411 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698