Index: chrome/browser/extensions/socket_apitest.cc |
diff --git a/chrome/browser/extensions/socket_apitest.cc b/chrome/browser/extensions/socket_apitest.cc |
deleted file mode 100644 |
index 9fc9138a84265c53e220f856603bcac60364137c..0000000000000000000000000000000000000000 |
--- a/chrome/browser/extensions/socket_apitest.cc |
+++ /dev/null |
@@ -1,68 +0,0 @@ |
-// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
-// Use of this source code is governed by a BSD-style license that can be |
-// found in the LICENSE file. |
- |
-#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/common/chrome_switches.h" |
-#include "chrome/test/base/in_process_browser_test.h" |
-#include "chrome/test/base/ui_test_utils.h" |
- |
-using namespace extension_function_test_utils; |
- |
-namespace { |
- |
-class SocketApiTest : public InProcessBrowserTest { |
-}; |
- |
-} |
- |
-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()); |
- |
- socket_create_function->set_extension(empty_extension.get()); |
- socket_create_function->set_has_callback(true); |
- |
- scoped_ptr<base::Value> result(RunFunctionAndReturnResult( |
- socket_create_function, "[\"udp\"]", browser(), NONE)); |
- ASSERT_EQ(base::Value::TYPE_DICTIONARY, result->GetType()); |
- DictionaryValue *value = static_cast<DictionaryValue*>(result.get()); |
- int socketId = -1; |
- EXPECT_TRUE(value->GetInteger("socketId", &socketId)); |
- EXPECT_EQ(42, socketId); |
-} |
- |
-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()); |
- |
- socket_create_function->set_extension(empty_extension.get()); |
- socket_create_function->set_has_callback(true); |
- |
- // TODO(miket): this test currently passes only because of artificial code |
- // that doesn't run in production. Fix this when we're able to. |
- RunFunctionAndReturnError(socket_create_function, "[\"xxxx\"]", browser(), |
- NONE); |
-} |
- |
-IN_PROC_BROWSER_TEST_F(ExtensionApiTest, SocketExtension) { |
- CommandLine::ForCurrentProcess()->AppendSwitch( |
- switches::kEnableExperimentalExtensionApis); |
- CommandLine::ForCurrentProcess()->AppendSwitch( |
- switches::kEnablePlatformApps); |
- |
- ASSERT_TRUE(RunExtensionTest("socket/api")) << message_; |
-} |