| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/basictypes.h" | 5 #include "base/basictypes.h" |
| 6 #include "chrome/browser/debugger/devtools_client_host.h" | 6 #include "chrome/browser/debugger/devtools_client_host.h" |
| 7 #include "chrome/browser/debugger/devtools_manager.h" | 7 #include "chrome/browser/debugger/devtools_manager.h" |
| 8 #include "chrome/browser/debugger/devtools_window.h" | 8 #include "chrome/browser/debugger/devtools_window.h" |
| 9 #include "chrome/browser/renderer_host/test/test_render_view_host.h" | 9 #include "chrome/browser/renderer_host/test/test_render_view_host.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 close_counter = 0; | 44 close_counter = 0; |
| 45 } | 45 } |
| 46 | 46 |
| 47 static int close_counter; | 47 static int close_counter; |
| 48 | 48 |
| 49 const IPC::Message* last_sent_message; | 49 const IPC::Message* last_sent_message; |
| 50 | 50 |
| 51 private: | 51 private: |
| 52 bool closed_; | 52 bool closed_; |
| 53 | 53 |
| 54 virtual void FrameNavigating(const std::string& url) {} |
| 55 |
| 54 DISALLOW_COPY_AND_ASSIGN(TestDevToolsClientHost); | 56 DISALLOW_COPY_AND_ASSIGN(TestDevToolsClientHost); |
| 55 }; | 57 }; |
| 56 | 58 |
| 57 int TestDevToolsClientHost::close_counter = 0; | 59 int TestDevToolsClientHost::close_counter = 0; |
| 58 | 60 |
| 59 } // namespace | 61 } // namespace |
| 60 | 62 |
| 61 class DevToolsManagerTest : public RenderViewHostTestHarness { | 63 class DevToolsManagerTest : public RenderViewHostTestHarness { |
| 62 public: | 64 public: |
| 63 DevToolsManagerTest() : RenderViewHostTestHarness() { | 65 DevToolsManagerTest() : RenderViewHostTestHarness() { |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 manager->RegisterDevToolsClientHostFor(rvh(), &client_host); | 103 manager->RegisterDevToolsClientHostFor(rvh(), &client_host); |
| 102 EXPECT_EQ(0, TestDevToolsClientHost::close_counter); | 104 EXPECT_EQ(0, TestDevToolsClientHost::close_counter); |
| 103 | 105 |
| 104 IPC::Message m; | 106 IPC::Message m; |
| 105 manager->ForwardToDevToolsClient(rvh(), m); | 107 manager->ForwardToDevToolsClient(rvh(), m); |
| 106 EXPECT_TRUE(&m == client_host.last_sent_message); | 108 EXPECT_TRUE(&m == client_host.last_sent_message); |
| 107 | 109 |
| 108 client_host.Close(); | 110 client_host.Close(); |
| 109 EXPECT_EQ(1, TestDevToolsClientHost::close_counter); | 111 EXPECT_EQ(1, TestDevToolsClientHost::close_counter); |
| 110 } | 112 } |
| OLD | NEW |