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

Unified Diff: content/browser/debugger/devtools_http_handler_unittest.cc

Issue 11630004: DevTools: rename debugger/ to devtools/, move DevTools files into content/renderer/devtools. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: For landing Created 8 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/debugger/devtools_http_handler_unittest.cc
diff --git a/content/browser/debugger/devtools_http_handler_unittest.cc b/content/browser/debugger/devtools_http_handler_unittest.cc
deleted file mode 100644
index b01c9d9ca6f7776493ad11c7a421ca40875e0152..0000000000000000000000000000000000000000
--- a/content/browser/debugger/devtools_http_handler_unittest.cc
+++ /dev/null
@@ -1,103 +0,0 @@
-// Copyright (c) 2012 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 "base/message_loop.h"
-#include "base/run_loop.h"
-#include "content/browser/browser_thread_impl.h"
-#include "content/public/browser/devtools_http_handler.h"
-#include "content/public/browser/devtools_http_handler_delegate.h"
-#include "net/base/stream_listen_socket.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace content {
-namespace {
-
-using net::StreamListenSocket;
-
-class DummyListenSocket : public StreamListenSocket,
- public StreamListenSocket::Delegate {
- public:
- DummyListenSocket()
- : ALLOW_THIS_IN_INITIALIZER_LIST(StreamListenSocket(0, this)) {}
-
- // StreamListenSocket::Delegate "implementation"
- virtual void DidAccept(StreamListenSocket* server,
- StreamListenSocket* connection) OVERRIDE {}
- virtual void DidRead(StreamListenSocket* connection,
- const char* data,
- int len) OVERRIDE {}
- virtual void DidClose(StreamListenSocket* sock) OVERRIDE {}
- protected:
- virtual ~DummyListenSocket() {}
- virtual void Accept() OVERRIDE {}
-};
-
-class DummyListenSocketFactory : public net::StreamListenSocketFactory {
- public:
- DummyListenSocketFactory(
- base::Closure quit_closure_1, base::Closure quit_closure_2)
- : quit_closure_1_(quit_closure_1), quit_closure_2_(quit_closure_2) {}
- virtual ~DummyListenSocketFactory() {
- BrowserThread::PostTask(
- BrowserThread::UI, FROM_HERE, quit_closure_2_);
- }
-
- virtual scoped_refptr<StreamListenSocket> CreateAndListen(
- StreamListenSocket::Delegate* delegate) const OVERRIDE {
- BrowserThread::PostTask(
- BrowserThread::UI, FROM_HERE, quit_closure_1_);
- return new DummyListenSocket();
- }
- private:
- base::Closure quit_closure_1_;
- base::Closure quit_closure_2_;
-};
-
-class DummyDelegate : public DevToolsHttpHandlerDelegate {
- public:
- virtual std::string GetDiscoveryPageHTML() OVERRIDE { return ""; }
- virtual bool BundlesFrontendResources() OVERRIDE { return true; }
- virtual FilePath GetDebugFrontendDir() OVERRIDE { return FilePath(); }
- virtual std::string GetPageThumbnailData(const GURL& url) { return ""; }
- virtual RenderViewHost* CreateNewTarget() { return NULL; }
-};
-
-}
-
-class DevToolsHttpHandlerTest : public testing::Test {
- public:
- DevToolsHttpHandlerTest()
- : ui_thread_(BrowserThread::UI, &message_loop_) {
- }
- protected:
- virtual void SetUp() {
- file_thread_.reset(new BrowserThreadImpl(BrowserThread::FILE));
- file_thread_->Start();
- }
- virtual void TearDown() {
- file_thread_->Stop();
- }
- private:
- MessageLoopForIO message_loop_;
- BrowserThreadImpl ui_thread_;
- scoped_ptr<BrowserThreadImpl> file_thread_;
-};
-
-TEST_F(DevToolsHttpHandlerTest, TestStartStop) {
- base::RunLoop run_loop, run_loop_2;
- content::DevToolsHttpHandler* devtools_http_handler_ =
- content::DevToolsHttpHandler::Start(
- new DummyListenSocketFactory(
- run_loop.QuitClosure(), run_loop_2.QuitClosure()),
- "",
- new DummyDelegate());
- // Our dummy socket factory will post a quit message once the server will
- // become ready.
- run_loop.Run();
- devtools_http_handler_->Stop();
- // Make sure the handler actually stops.
- run_loop_2.Run();
-}
-
-} // namespace content
« no previous file with comments | « content/browser/debugger/devtools_http_handler_impl.cc ('k') | content/browser/debugger/devtools_manager_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698