| 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/files/file_util.h" | 5 #include "base/files/file_util.h" |
| 6 #include "base/files/scoped_temp_dir.h" | 6 #include "base/files/scoped_temp_dir.h" |
| 7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
| 8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
| 9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 10 #include "content/browser/browser_thread_impl.h" | 10 #include "content/browser/browser_thread_impl.h" |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 }; | 77 }; |
| 78 | 78 |
| 79 class DummyDelegate : public DevToolsHttpHandlerDelegate { | 79 class DummyDelegate : public DevToolsHttpHandlerDelegate { |
| 80 public: | 80 public: |
| 81 std::string GetDiscoveryPageHTML() override { return std::string(); } | 81 std::string GetDiscoveryPageHTML() override { return std::string(); } |
| 82 | 82 |
| 83 bool BundlesFrontendResources() override { return true; } | 83 bool BundlesFrontendResources() override { return true; } |
| 84 | 84 |
| 85 base::FilePath GetDebugFrontendDir() override { return base::FilePath(); } | 85 base::FilePath GetDebugFrontendDir() override { return base::FilePath(); } |
| 86 | 86 |
| 87 scoped_ptr<net::StreamListenSocket> CreateSocketForTethering( | 87 scoped_ptr<net::ServerSocket> |
| 88 net::StreamListenSocket::Delegate* delegate, | 88 CreateSocketForTethering(std::string* name) override { |
| 89 std::string* name) override { | 89 return scoped_ptr<net::ServerSocket>(); |
| 90 return scoped_ptr<net::StreamListenSocket>(); | |
| 91 } | 90 } |
| 92 }; | 91 }; |
| 93 | 92 |
| 94 } | 93 } |
| 95 | 94 |
| 96 class DevToolsHttpHandlerTest : public testing::Test { | 95 class DevToolsHttpHandlerTest : public testing::Test { |
| 97 public: | 96 public: |
| 98 DevToolsHttpHandlerTest() | 97 DevToolsHttpHandlerTest() |
| 99 : ui_thread_(BrowserThread::UI, &message_loop_) { | 98 : ui_thread_(BrowserThread::UI, &message_loop_) { |
| 100 } | 99 } |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 kDevToolsActivePortFileName); | 155 kDevToolsActivePortFileName); |
| 157 EXPECT_TRUE(base::PathExists(active_port_file)); | 156 EXPECT_TRUE(base::PathExists(active_port_file)); |
| 158 std::string file_contents; | 157 std::string file_contents; |
| 159 EXPECT_TRUE(base::ReadFileToString(active_port_file, &file_contents)); | 158 EXPECT_TRUE(base::ReadFileToString(active_port_file, &file_contents)); |
| 160 int port = 0; | 159 int port = 0; |
| 161 EXPECT_TRUE(base::StringToInt(file_contents, &port)); | 160 EXPECT_TRUE(base::StringToInt(file_contents, &port)); |
| 162 EXPECT_EQ(kDummyPort, port); | 161 EXPECT_EQ(kDummyPort, port); |
| 163 } | 162 } |
| 164 | 163 |
| 165 } // namespace content | 164 } // namespace content |
| OLD | NEW |