| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/memory/discardable_memory.h" | 6 #include "base/memory/discardable_memory.h" |
| 7 #include "base/memory/scoped_vector.h" | 7 #include "base/memory/scoped_vector.h" |
| 8 #include "content/public/browser/content_browser_client.h" | 8 #include "content/public/browser/content_browser_client.h" |
| 9 #include "content/public/common/content_client.h" | 9 #include "content/public/common/content_client.h" |
| 10 #include "content/public/common/content_switches.h" | 10 #include "content/public/common/content_switches.h" |
| 11 #include "content/public/renderer/content_renderer_client.h" | 11 #include "content/public/renderer/content_renderer_client.h" |
| 12 #include "content/renderer/render_process_impl.h" | 12 #include "content/renderer/render_process_impl.h" |
| 13 #include "content/renderer/render_thread_impl.h" | 13 #include "content/renderer/render_thread_impl.h" |
| 14 #include "content/test/mock_render_process.h" | 14 #include "content/test/mock_render_process.h" |
| 15 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
| 16 | 16 |
| 17 namespace content { | 17 namespace content { |
| 18 namespace { | 18 namespace { |
| 19 | 19 |
| 20 class RenderThreadImplBrowserTest : public testing::Test { | 20 class RenderThreadImplBrowserTest : public testing::Test { |
| 21 public: | 21 public: |
| 22 virtual ~RenderThreadImplBrowserTest() {} | 22 virtual ~RenderThreadImplBrowserTest() {} |
| 23 }; | 23 }; |
| 24 | 24 |
| 25 class DummyListener : public IPC::Listener { | 25 class DummyListener : public IPC::Listener { |
| 26 public: | 26 public: |
| 27 virtual bool OnMessageReceived(const IPC::Message& message) override { | 27 bool OnMessageReceived(const IPC::Message& message) override { return true; } |
| 28 return true; | |
| 29 } | |
| 30 }; | 28 }; |
| 31 | 29 |
| 32 void CheckRenderThreadInputHandlerManager(RenderThreadImpl* thread) { | 30 void CheckRenderThreadInputHandlerManager(RenderThreadImpl* thread) { |
| 33 ASSERT_TRUE(thread->input_handler_manager()); | 31 ASSERT_TRUE(thread->input_handler_manager()); |
| 34 } | 32 } |
| 35 | 33 |
| 36 // Check that InputHandlerManager outlives compositor thread because it uses | 34 // Check that InputHandlerManager outlives compositor thread because it uses |
| 37 // raw pointers to post tasks. | 35 // raw pointers to post tasks. |
| 38 // Disabled under LeakSanitizer due to memory leaks. http://crbug.com/348994 | 36 // Disabled under LeakSanitizer due to memory leaks. http://crbug.com/348994 |
| 39 #if defined(LEAK_SANITIZER) | 37 #if defined(LEAK_SANITIZER) |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 if ((*iter)->Lock() == base::DISCARDABLE_MEMORY_LOCK_STATUS_SUCCESS) | 123 if ((*iter)->Lock() == base::DISCARDABLE_MEMORY_LOCK_STATUS_SUCCESS) |
| 126 ++blocks_left; | 124 ++blocks_left; |
| 127 } | 125 } |
| 128 EXPECT_LE(blocks_left, 1); | 126 EXPECT_LE(blocks_left, 1); |
| 129 | 127 |
| 130 thread->WidgetDestroyed(); | 128 thread->WidgetDestroyed(); |
| 131 } | 129 } |
| 132 | 130 |
| 133 } // namespace | 131 } // namespace |
| 134 } // namespace content | 132 } // namespace content |
| OLD | NEW |