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

Side by Side Diff: extensions/browser/api/sockets_tcp_server/sockets_tcp_server_apitest.cc

Issue 2539363004: Make base::Value::TYPE a scoped enum. (Closed)
Patch Set: Rebase Created 4 years 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <utility> 5 #include <utility>
6 6
7 #include "base/memory/ref_counted.h" 7 #include "base/memory/ref_counted.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "extensions/browser/api/dns/host_resolver_wrapper.h" 9 #include "extensions/browser/api/dns/host_resolver_wrapper.h"
10 #include "extensions/browser/api/dns/mock_host_resolver_creator.h" 10 #include "extensions/browser/api/dns/mock_host_resolver_creator.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 scoped_refptr<api::SocketsTcpServerCreateFunction> socket_create_function( 56 scoped_refptr<api::SocketsTcpServerCreateFunction> socket_create_function(
57 new api::SocketsTcpServerCreateFunction()); 57 new api::SocketsTcpServerCreateFunction());
58 scoped_refptr<Extension> empty_extension(test_util::CreateEmptyExtension()); 58 scoped_refptr<Extension> empty_extension(test_util::CreateEmptyExtension());
59 59
60 socket_create_function->set_extension(empty_extension.get()); 60 socket_create_function->set_extension(empty_extension.get());
61 socket_create_function->set_has_callback(true); 61 socket_create_function->set_has_callback(true);
62 62
63 std::unique_ptr<base::Value> result( 63 std::unique_ptr<base::Value> result(
64 api_test_utils::RunFunctionAndReturnSingleResult( 64 api_test_utils::RunFunctionAndReturnSingleResult(
65 socket_create_function.get(), "[]", browser_context())); 65 socket_create_function.get(), "[]", browser_context()));
66 ASSERT_EQ(base::Value::TYPE_DICTIONARY, result->GetType()); 66 ASSERT_EQ(base::Value::Type::DICTIONARY, result->GetType());
67 std::unique_ptr<base::DictionaryValue> value = 67 std::unique_ptr<base::DictionaryValue> value =
68 base::DictionaryValue::From(std::move(result)); 68 base::DictionaryValue::From(std::move(result));
69 int socketId = -1; 69 int socketId = -1;
70 EXPECT_TRUE(value->GetInteger("socketId", &socketId)); 70 EXPECT_TRUE(value->GetInteger("socketId", &socketId));
71 ASSERT_TRUE(socketId > 0); 71 ASSERT_TRUE(socketId > 0);
72 } 72 }
73 73
74 IN_PROC_BROWSER_TEST_F(SocketsTcpServerApiTest, SocketTCPServerExtension) { 74 IN_PROC_BROWSER_TEST_F(SocketsTcpServerApiTest, SocketTCPServerExtension) {
75 ResultCatcher catcher; 75 ResultCatcher catcher;
76 catcher.RestrictToBrowserContext(browser_context()); 76 catcher.RestrictToBrowserContext(browser_context());
(...skipping 15 matching lines...) Expand all
92 ASSERT_TRUE(extension); 92 ASSERT_TRUE(extension);
93 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); 93 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message();
94 94
95 UnloadApp(extension); 95 UnloadApp(extension);
96 96
97 ASSERT_TRUE(LoadApp(path)) << message_; 97 ASSERT_TRUE(LoadApp(path)) << message_;
98 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); 98 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message();
99 } 99 }
100 100
101 } // namespace extensions 101 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/api/sockets_tcp/sockets_tcp_apitest.cc ('k') | extensions/browser/api/storage/storage_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698