OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/values.h" | 5 #include "base/values.h" |
6 #include "chrome/browser/browser_process_impl.h" | 6 #include "chrome/browser/browser_process_impl.h" |
7 #include "chrome/browser/extensions/api/socket/socket_api.h" | 7 #include "chrome/browser/extensions/api/socket/socket_api.h" |
8 #include "chrome/browser/extensions/extension_function_test_utils.h" | 8 #include "chrome/browser/extensions/extension_function_test_utils.h" |
9 #include "chrome/browser/extensions/test_extension_system.h" | 9 #include "chrome/browser/extensions/test_extension_system.h" |
10 #include "chrome/browser/profiles/profile_manager.h" | 10 #include "chrome/browser/profiles/profile_manager.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 TEST_F(SocketUnitTest, Create) { | 67 TEST_F(SocketUnitTest, Create) { |
68 // TODO(miket): enable this test. This will require teaching | 68 // TODO(miket): enable this test. This will require teaching |
69 // SocketCreateFunction to do its work on a thread other than IO. Getting | 69 // SocketCreateFunction to do its work on a thread other than IO. Getting |
70 // this CL landed was hard enough already, so we're going to save this work | 70 // this CL landed was hard enough already, so we're going to save this work |
71 // for another day. | 71 // for another day. |
72 if (false) { | 72 if (false) { |
73 scoped_ptr<base::DictionaryValue> result(RunFunctionAndReturnDict( | 73 scoped_ptr<base::DictionaryValue> result(RunFunctionAndReturnDict( |
74 new SocketCreateFunction(), "[\"tcp\"]")); | 74 new SocketCreateFunction(), "[\"tcp\"]")); |
75 ASSERT_TRUE(result.get()); | 75 ASSERT_TRUE(result.get()); |
76 } | 76 } |
77 { | |
78 std::string error = RunFunctionAndReturnError( | |
79 new SocketCreateFunction(), "[\"nonexistent-socket-type\"]"); | |
80 ASSERT_FALSE(error.empty()) << "Expected error. Got nothing instead."; | |
81 } | |
82 } | 77 } |
83 | 78 |
84 } // namespace extensions | 79 } // namespace extensions |
OLD | NEW |