OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/bind.h" | 5 #include "base/bind.h" |
6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
7 #include "content/child/child_discardable_shared_memory_manager.h" | 7 #include "content/child/child_discardable_shared_memory_manager.h" |
8 #include "content/child/child_thread_impl.h" | 8 #include "content/child/child_thread_impl.h" |
9 #include "content/common/host_discardable_shared_memory_manager.h" | 9 #include "content/common/host_discardable_shared_memory_manager.h" |
10 #include "content/public/common/content_switches.h" | 10 #include "content/public/common/content_switches.h" |
11 #include "content/public/test/content_browser_test.h" | 11 #include "content/public/test/content_browser_test.h" |
12 #include "content/public/test/content_browser_test_utils.h" | 12 #include "content/public/test/content_browser_test_utils.h" |
13 #include "content/shell/browser/shell.h" | 13 #include "content/shell/browser/shell.h" |
14 #include "url/gurl.h" | 14 #include "url/gurl.h" |
15 | 15 |
16 namespace content { | 16 namespace content { |
17 | 17 |
| 18 // ChromeOS does not do software compositing, so kDisableGpu is not available |
| 19 // there. |
| 20 #if !defined(OS_CHROMEOS) |
| 21 |
18 class ChildDiscardableSharedMemoryManagerBrowserTest | 22 class ChildDiscardableSharedMemoryManagerBrowserTest |
19 : public ContentBrowserTest { | 23 : public ContentBrowserTest { |
20 public: | 24 public: |
21 void SetUpCommandLine(base::CommandLine* command_line) override { | 25 void SetUpCommandLine(base::CommandLine* command_line) override { |
22 command_line->AppendSwitch(switches::kSingleProcess); | 26 command_line->AppendSwitch(switches::kSingleProcess); |
23 command_line->AppendSwitch(switches::kDisableGpu); | 27 command_line->AppendSwitch(switches::kDisableGpu); |
24 } | 28 } |
25 | 29 |
26 static void ReleaseFreeMemory() { | 30 static void ReleaseFreeMemory() { |
27 ChildThreadImpl::current() | 31 ChildThreadImpl::current() |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 memory.get())); | 115 memory.get())); |
112 } | 116 } |
113 | 117 |
114 for (auto& memory : instances) { | 118 for (auto& memory : instances) { |
115 PostTaskToInProcessRendererAndWait( | 119 PostTaskToInProcessRendererAndWait( |
116 base::Bind(&ChildDiscardableSharedMemoryManagerBrowserTest::FreeMemory, | 120 base::Bind(&ChildDiscardableSharedMemoryManagerBrowserTest::FreeMemory, |
117 base::Passed(&memory))); | 121 base::Passed(&memory))); |
118 } | 122 } |
119 } | 123 } |
120 | 124 |
| 125 #endif // !OS_CHROMEOS |
| 126 |
121 } // content | 127 } // content |
OLD | NEW |