Set the Feature's ChannelForTesting to Trunk during extension tests, so that

they pass on beta/stable builds even if the features are restricted to
dev/trunk.

BUG=136629
TEST=no

Review URL: https://chromiumcodereview.appspot.com/10704149

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@146156 0039d316-1c4b-4281-b951-d872f2087c98
parent b0c5dfb6
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include "chrome/common/chrome_notification_types.h" #include "chrome/common/chrome_notification_types.h"
#include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h" #include "chrome/common/chrome_switches.h"
#include "chrome/common/extensions/features/feature.h"
#include "chrome/test/base/ui_test_utils.h" #include "chrome/test/base/ui_test_utils.h"
#include "content/public/browser/navigation_controller.h" #include "content/public/browser/navigation_controller.h"
#include "content/public/browser/navigation_entry.h" #include "content/public/browser/navigation_entry.h"
...@@ -58,6 +59,9 @@ void ExtensionBrowserTest::SetUpCommandLine(CommandLine* command_line) { ...@@ -58,6 +59,9 @@ void ExtensionBrowserTest::SetUpCommandLine(CommandLine* command_line) {
// This enables DOM automation for tab contentses. // This enables DOM automation for tab contentses.
EnableDOMAutomation(); EnableDOMAutomation();
extensions::Feature::SetChannelForTesting(
chrome::VersionInfo::CHANNEL_UNKNOWN);
PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir_); PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir_);
test_data_dir_ = test_data_dir_.AppendASCII("extensions"); test_data_dir_ = test_data_dir_.AppendASCII("extensions");
......
...@@ -71,7 +71,7 @@ class LoadedIncognitoObserver : public content::NotificationObserver { ...@@ -71,7 +71,7 @@ class LoadedIncognitoObserver : public content::NotificationObserver {
} // namespace } // namespace
class LazyBackgroundPageApiTest : public ExtensionApiTest { class LazyBackgroundPageApiTest : public ExtensionApiTest {
public: public:
void SetUpCommandLine(CommandLine* command_line) { void SetUpCommandLine(CommandLine* command_line) {
ExtensionApiTest::SetUpCommandLine(command_line); ExtensionApiTest::SetUpCommandLine(command_line);
command_line->AppendSwitch(switches::kEnableExperimentalExtensionApis); command_line->AppendSwitch(switches::kEnableExperimentalExtensionApis);
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include "chrome/common/extensions/extension.h" #include "chrome/common/extensions/extension.h"
#include "chrome/common/extensions/extension_error_utils.h" #include "chrome/common/extensions/extension_error_utils.h"
#include "chrome/common/extensions/extension_manifest_constants.h" #include "chrome/common/extensions/extension_manifest_constants.h"
#include "chrome/common/extensions/features/feature.h"
#include "chrome/common/extensions/features/simple_feature_provider.h" #include "chrome/common/extensions/features/simple_feature_provider.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
...@@ -88,6 +89,7 @@ TEST_F(ExtensionManifestTest, BackgroundAllowNoJsAccess) { ...@@ -88,6 +89,7 @@ TEST_F(ExtensionManifestTest, BackgroundAllowNoJsAccess) {
TEST_F(ExtensionManifestTest, BackgroundPageWebRequest) { TEST_F(ExtensionManifestTest, BackgroundPageWebRequest) {
CommandLine::ForCurrentProcess()->AppendSwitch( CommandLine::ForCurrentProcess()->AppendSwitch(
switches::kEnableExperimentalExtensionApis); switches::kEnableExperimentalExtensionApis);
Feature::SetChannelForTesting(chrome::VersionInfo::CHANNEL_UNKNOWN);
std::string error; std::string error;
scoped_ptr<DictionaryValue> manifest( scoped_ptr<DictionaryValue> manifest(
......
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