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

Unified Diff: extensions/browser/api/sockets_tcp/sockets_tcp_apitest.cc

Issue 449303002: Move SocketsTcpApiTest.SocketsTcpCreateGood to app_shell_browsertests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Yoyo comments. Created 6 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 | « extensions/browser/api/dns/dns_apitest.cc ('k') | extensions/browser/api_test_utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/api/sockets_tcp/sockets_tcp_apitest.cc
diff --git a/extensions/browser/api/sockets_tcp/sockets_tcp_apitest.cc b/extensions/browser/api/sockets_tcp/sockets_tcp_apitest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..df0ddeacca171ee3be2a041a536faf76934431ca
--- /dev/null
+++ b/extensions/browser/api/sockets_tcp/sockets_tcp_apitest.cc
@@ -0,0 +1,37 @@
+// Copyright 2014 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 "extensions/browser/api/sockets_tcp/sockets_tcp_api.h"
+#include "extensions/browser/api_test_utils.h"
+#include "extensions/common/extension.h"
+#include "extensions/common/test_util.h"
+#include "extensions/shell/test/shell_test.h"
+
+using extensions::api_test_utils::RunFunctionAndReturnSingleResult;
+
+namespace extensions {
+
+class SocketsTcpApiTest : public AppShellTest {};
+
+IN_PROC_BROWSER_TEST_F(SocketsTcpApiTest, SocketsTcpCreateGood) {
+ scoped_refptr<extensions::core_api::SocketsTcpCreateFunction>
+ socket_create_function(
+ new extensions::core_api::SocketsTcpCreateFunction());
+ scoped_refptr<Extension> empty_extension = test_util::CreateEmptyExtension();
+
+ socket_create_function->set_extension(empty_extension.get());
+ socket_create_function->set_has_callback(true);
+
+ scoped_ptr<base::Value> result(RunFunctionAndReturnSingleResult(
+ socket_create_function.get(), "[]", browser_context()));
+
+ ASSERT_EQ(base::Value::TYPE_DICTIONARY, result->GetType());
+ base::DictionaryValue* value =
+ static_cast<base::DictionaryValue*>(result.get());
+ int socketId = -1;
+ EXPECT_TRUE(value->GetInteger("socketId", &socketId));
+ ASSERT_TRUE(socketId > 0);
+}
+
+} // namespace extensions
« no previous file with comments | « extensions/browser/api/dns/dns_apitest.cc ('k') | extensions/browser/api_test_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698