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 3871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4081 } | 4080 } |
4082 }; | 4081 }; |
4083 | 4082 |
4084 // Checks that prerendering works in incognito mode. | 4083 // Checks that prerendering works in incognito mode. |
4085 IN_PROC_BROWSER_TEST_F(PrerenderIncognitoBrowserTest, PrerenderIncognito) { | 4084 IN_PROC_BROWSER_TEST_F(PrerenderIncognitoBrowserTest, PrerenderIncognito) { |
4086 PrerenderTestURL("files/prerender/prerender_page.html", FINAL_STATUS_USED, 1); | 4085 PrerenderTestURL("files/prerender/prerender_page.html", FINAL_STATUS_USED, 1); |
4087 NavigateToDestURL(); | 4086 NavigateToDestURL(); |
4088 } | 4087 } |
4089 | 4088 |
4090 } // namespace prerender | 4089 } // namespace prerender |
OLD | NEW |