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/message_loop.h" | 5 #include "base/message_loop.h" |
6 #include "base/run_loop.h" | 6 #include "base/run_loop.h" |
7 #include "content/browser/browser_thread_impl.h" | 7 #include "content/browser/browser_thread_impl.h" |
8 #include "content/public/browser/devtools_http_handler.h" | 8 #include "content/public/browser/devtools_http_handler.h" |
9 #include "content/public/browser/devtools_http_handler_delegate.h" | 9 #include "content/public/browser/devtools_http_handler_delegate.h" |
10 #include "net/base/stream_listen_socket.h" | 10 #include "net/base/stream_listen_socket.h" |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 } | 77 } |
78 virtual void TearDown() { | 78 virtual void TearDown() { |
79 file_thread_->Stop(); | 79 file_thread_->Stop(); |
80 } | 80 } |
81 private: | 81 private: |
82 MessageLoopForIO message_loop_; | 82 MessageLoopForIO message_loop_; |
83 BrowserThreadImpl ui_thread_; | 83 BrowserThreadImpl ui_thread_; |
84 scoped_ptr<BrowserThreadImpl> file_thread_; | 84 scoped_ptr<BrowserThreadImpl> file_thread_; |
85 }; | 85 }; |
86 | 86 |
87 TEST_F(DevToolsHttpHandlerTest, TestStartStop) { | 87 // Sometimes, an assertion fails in NotificationRegistrar. http://crbug.com/1610
27 |
| 88 #if defined(OS_ANDROID) |
| 89 #define MAYBE_TestStartStop DISABLED_TestStartStop |
| 90 #else |
| 91 #define MAYBE_TestStartStop TestStartStop |
| 92 #endif |
| 93 |
| 94 TEST_F(DevToolsHttpHandlerTest, MAYBE_TestStartStop) { |
88 base::RunLoop run_loop, run_loop_2; | 95 base::RunLoop run_loop, run_loop_2; |
89 content::DevToolsHttpHandler* devtools_http_handler_ = | 96 content::DevToolsHttpHandler* devtools_http_handler_ = |
90 content::DevToolsHttpHandler::Start( | 97 content::DevToolsHttpHandler::Start( |
91 new DummyListenSocketFactory( | 98 new DummyListenSocketFactory( |
92 run_loop.QuitClosure(), run_loop_2.QuitClosure()), | 99 run_loop.QuitClosure(), run_loop_2.QuitClosure()), |
93 "", | 100 "", |
94 new DummyDelegate()); | 101 new DummyDelegate()); |
95 // Our dummy socket factory will post a quit message once the server will | 102 // Our dummy socket factory will post a quit message once the server will |
96 // become ready. | 103 // become ready. |
97 run_loop.Run(); | 104 run_loop.Run(); |
98 devtools_http_handler_->Stop(); | 105 devtools_http_handler_->Stop(); |
99 // Make sure the handler actually stops. | 106 // Make sure the handler actually stops. |
100 run_loop_2.Run(); | 107 run_loop_2.Run(); |
101 } | 108 } |
102 | 109 |
103 } // namespace content | 110 } // namespace content |
OLD | NEW |