Commit 854bc43f authored by Devlin Cronin's avatar Devlin Cronin Committed by Commit Bot

[Extensions Cleanup] Constify extensions in api_unittest

In practice, Extension objects are pretty much always const. Update
extensions/browser/api_unittest.h to use const Extension objects, rather
than mutable ones.

Bug: 889925
Change-Id: I7e13dac4376eb0e358a30e2fe49154976f02fb0d
Reviewed-on: https://chromium-review.googlesource.com/1252008Reviewed-by: default avatarKaran Bhatia <karandeepb@chromium.org>
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#595200}
parent 1751f079
...@@ -642,7 +642,7 @@ TEST_F(ExtensionAlarmsSchedulingTest, DifferentMinimumGranularities) { ...@@ -642,7 +642,7 @@ TEST_F(ExtensionAlarmsSchedulingTest, DifferentMinimumGranularities) {
// Create a new extension, which is packed, and has a granularity of 1 minute. // Create a new extension, which is packed, and has a granularity of 1 minute.
// CreateAlarm() uses extension_, so keep a ref of the old one around, and // CreateAlarm() uses extension_, so keep a ref of the old one around, and
// repopulate extension_. // repopulate extension_.
scoped_refptr<Extension> extension2(extension_ref()); scoped_refptr<const Extension> extension2(extension_ref());
set_extension( set_extension(
utils::CreateEmptyExtensionWithLocation(extensions::Manifest::INTERNAL)); utils::CreateEmptyExtensionWithLocation(extensions::Manifest::INTERNAL));
......
...@@ -39,8 +39,8 @@ class ApiUnitTest : public ExtensionsTest { ...@@ -39,8 +39,8 @@ class ApiUnitTest : public ExtensionsTest {
content::WebContents* contents() { return contents_.get(); } content::WebContents* contents() { return contents_.get(); }
const Extension* extension() const { return extension_.get(); } const Extension* extension() const { return extension_.get(); }
scoped_refptr<Extension> extension_ref() { return extension_; } scoped_refptr<const Extension> extension_ref() { return extension_; }
void set_extension(scoped_refptr<Extension> extension) { void set_extension(scoped_refptr<const Extension> extension) {
extension_ = extension; extension_ = extension;
} }
...@@ -92,7 +92,7 @@ class ApiUnitTest : public ExtensionsTest { ...@@ -92,7 +92,7 @@ class ApiUnitTest : public ExtensionsTest {
std::unique_ptr<content::WebContents> contents_; std::unique_ptr<content::WebContents> contents_;
// The Extension used when running API function calls. // The Extension used when running API function calls.
scoped_refptr<Extension> extension_; scoped_refptr<const Extension> extension_;
}; };
} // namespace extensions } // namespace extensions
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment