Index: chrome/browser/extensions/api/socket/socket_apitest.cc |
diff --git a/chrome/browser/extensions/socket_apitest.cc b/chrome/browser/extensions/api/socket/socket_apitest.cc |
similarity index 76% |
rename from chrome/browser/extensions/socket_apitest.cc |
rename to chrome/browser/extensions/api/socket/socket_apitest.cc |
index 9fc9138a84265c53e220f856603bcac60364137c..ea2c6bea64e0d7b4f5e62c6a87ad0919c6e50c7e 100644 |
--- a/chrome/browser/extensions/socket_apitest.cc |
+++ b/chrome/browser/extensions/api/socket/socket_apitest.cc |
@@ -5,7 +5,7 @@ |
#include "base/command_line.h" |
#include "chrome/browser/extensions/extension_apitest.h" |
#include "chrome/browser/extensions/extension_function_test_utils.h" |
-#include "chrome/browser/extensions/socket_api.h" |
+#include "chrome/browser/extensions/api/socket/socket_api.h" |
#include "chrome/common/chrome_switches.h" |
#include "chrome/test/base/in_process_browser_test.h" |
#include "chrome/test/base/ui_test_utils.h" |
@@ -15,15 +15,23 @@ using namespace extension_function_test_utils; |
namespace { |
class SocketApiTest : public InProcessBrowserTest { |
+ public: |
+ virtual void SetUp() { |
+ SetUpCommandLine(); |
+ } |
+ |
+ // A static convenience method to let SocketExtension call our setup method. |
+ static void SetUpCommandLine() { |
+ CommandLine::ForCurrentProcess()->AppendSwitch( |
+ switches::kEnableExperimentalExtensionApis); |
+ CommandLine::ForCurrentProcess()->AppendSwitch( |
+ switches::kEnablePlatformApps); |
+ } |
}; |
} |
IN_PROC_BROWSER_TEST_F(SocketApiTest, SocketCreateGood) { |
- CommandLine::ForCurrentProcess()->AppendSwitch( |
- switches::kEnableExperimentalExtensionApis); |
- CommandLine::ForCurrentProcess()->AppendSwitch( |
- switches::kEnablePlatformApps); |
scoped_refptr<extensions::SocketCreateFunction> socket_create_function( |
new extensions::SocketCreateFunction()); |
scoped_refptr<Extension> empty_extension(CreateEmptyExtension()); |
@@ -41,10 +49,6 @@ IN_PROC_BROWSER_TEST_F(SocketApiTest, SocketCreateGood) { |
} |
IN_PROC_BROWSER_TEST_F(SocketApiTest, SocketCreateBad) { |
- CommandLine::ForCurrentProcess()->AppendSwitch( |
- switches::kEnableExperimentalExtensionApis); |
- CommandLine::ForCurrentProcess()->AppendSwitch( |
- switches::kEnablePlatformApps); |
scoped_refptr<extensions::SocketCreateFunction> socket_create_function( |
new extensions::SocketCreateFunction()); |
scoped_refptr<Extension> empty_extension(CreateEmptyExtension()); |
@@ -59,10 +63,6 @@ IN_PROC_BROWSER_TEST_F(SocketApiTest, SocketCreateBad) { |
} |
IN_PROC_BROWSER_TEST_F(ExtensionApiTest, SocketExtension) { |
- CommandLine::ForCurrentProcess()->AppendSwitch( |
- switches::kEnableExperimentalExtensionApis); |
- CommandLine::ForCurrentProcess()->AppendSwitch( |
- switches::kEnablePlatformApps); |
- |
+ SocketApiTest::SetUpCommandLine(); |
ASSERT_TRUE(RunExtensionTest("socket/api")) << message_; |
} |