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

Unified Diff: chrome/browser/extensions/active_tab_unittest.cc

Issue 10826298: Force the channel to be dev for active tab and manfiest unit tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/common/extensions/manifest_tests/extension_manifest_test.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/active_tab_unittest.cc
diff --git a/chrome/browser/extensions/active_tab_unittest.cc b/chrome/browser/extensions/active_tab_unittest.cc
index 8d89be6effcd11b81fa9efa80ff55f2334252a7d..1cee2f9c5d1a8e013ed32205dfdc1cc58606fd5f 100644
--- a/chrome/browser/extensions/active_tab_unittest.cc
+++ b/chrome/browser/extensions/active_tab_unittest.cc
@@ -55,11 +55,11 @@ scoped_refptr<const Extension> CreateTestExtension(
class ActiveTabTest : public TabContentsTestHarness {
public:
ActiveTabTest()
- : extension(CreateTestExtension("deadbeef", true)),
+ : current_channel_(chrome::VersionInfo::CHANNEL_DEV),
+ extension(CreateTestExtension("deadbeef", true)),
another_extension(CreateTestExtension("feedbeef", true)),
extension_without_active_tab(CreateTestExtension("badbeef", false)),
- ui_thread_(BrowserThread::UI, MessageLoop::current()),
- current_channel_(chrome::VersionInfo::CHANNEL_DEV) {}
+ ui_thread_(BrowserThread::UI, MessageLoop::current()) {}
protected:
int tab_id() {
@@ -106,6 +106,11 @@ class ActiveTabTest : public TabContentsTestHarness {
return extension->HasAPIPermissionForTab(tab_id, APIPermission::kTab);
}
+ // Force the test to run in dev channel because the permission is only
+ // available in dev channel. Without declaring this first, the extensions
+ // below won't load due to manifest errors.
+ Feature::ScopedCurrentChannel current_channel_;
+
// An extension with the activeTab permission.
scoped_refptr<const Extension> extension;
@@ -117,7 +122,6 @@ class ActiveTabTest : public TabContentsTestHarness {
private:
content::TestBrowserThread ui_thread_;
- Feature::ScopedCurrentChannel current_channel_;
};
TEST_F(ActiveTabTest, GrantToSinglePage) {
« no previous file with comments | « no previous file | chrome/common/extensions/manifest_tests/extension_manifest_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698