| 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 <deque> | 5 #include <deque> |
| 6 #include <vector> | 6 #include <vector> |
| 7 | 7 |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 run_loop_.Run(); | 188 run_loop_.Run(); |
| 189 EXPECT_TRUE(channel_destroyed_); | 189 EXPECT_TRUE(channel_destroyed_); |
| 190 } | 190 } |
| 191 | 191 |
| 192 private: | 192 private: |
| 193 // When destroyed, calls ChannelDestructionWatcher::OnChannelDestroyed. | 193 // When destroyed, calls ChannelDestructionWatcher::OnChannelDestroyed. |
| 194 // Ignores all messages. | 194 // Ignores all messages. |
| 195 class DestructionMessageFilter : public content::BrowserMessageFilter { | 195 class DestructionMessageFilter : public content::BrowserMessageFilter { |
| 196 public: | 196 public: |
| 197 explicit DestructionMessageFilter(ChannelDestructionWatcher* watcher) | 197 explicit DestructionMessageFilter(ChannelDestructionWatcher* watcher) |
| 198 : BrowserMessageFilter(0), | 198 : watcher_(watcher) { |
| 199 watcher_(watcher) { | |
| 200 } | 199 } |
| 201 | 200 |
| 202 private: | 201 private: |
| 203 virtual ~DestructionMessageFilter() { | 202 virtual ~DestructionMessageFilter() { |
| 204 content::BrowserThread::PostTask( | 203 content::BrowserThread::PostTask( |
| 205 content::BrowserThread::UI, FROM_HERE, | 204 content::BrowserThread::UI, FROM_HERE, |
| 206 base::Bind(&ChannelDestructionWatcher::OnChannelDestroyed, | 205 base::Bind(&ChannelDestructionWatcher::OnChannelDestroyed, |
| 207 base::Unretained(watcher_))); | 206 base::Unretained(watcher_))); |
| 208 } | 207 } |
| 209 | 208 |
| (...skipping 3858 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4068 } | 4067 } |
| 4069 }; | 4068 }; |
| 4070 | 4069 |
| 4071 // Checks that prerendering works in incognito mode. | 4070 // Checks that prerendering works in incognito mode. |
| 4072 IN_PROC_BROWSER_TEST_F(PrerenderIncognitoBrowserTest, PrerenderIncognito) { | 4071 IN_PROC_BROWSER_TEST_F(PrerenderIncognitoBrowserTest, PrerenderIncognito) { |
| 4073 PrerenderTestURL("files/prerender/prerender_page.html", FINAL_STATUS_USED, 1); | 4072 PrerenderTestURL("files/prerender/prerender_page.html", FINAL_STATUS_USED, 1); |
| 4074 NavigateToDestURL(); | 4073 NavigateToDestURL(); |
| 4075 } | 4074 } |
| 4076 | 4075 |
| 4077 } // namespace prerender | 4076 } // namespace prerender |
| OLD | NEW |