OLD | NEW |
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2014 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/run_loop.h" |
5 #include "build/build_config.h" | 6 #include "build/build_config.h" |
6 #include "content/browser/frame_host/frame_tree.h" | 7 #include "content/browser/frame_host/frame_tree.h" |
7 #include "content/browser/site_per_process_browsertest.h" | 8 #include "content/browser/site_per_process_browsertest.h" |
8 #include "content/browser/web_contents/web_contents_impl.h" | 9 #include "content/browser/web_contents/web_contents_impl.h" |
9 #include "content/public/browser/devtools_agent_host.h" | 10 #include "content/public/browser/devtools_agent_host.h" |
10 #include "content/public/test/content_browser_test_utils.h" | 11 #include "content/public/test/content_browser_test_utils.h" |
11 #include "content/public/test/test_utils.h" | 12 #include "content/public/test/test_utils.h" |
12 #include "content/shell/browser/shell.h" | 13 #include "content/shell/browser/shell.h" |
13 #include "content/test/content_browser_test_utils_internal.h" | 14 #include "content/test/content_browser_test_utils_internal.h" |
14 #include "net/dns/mock_host_resolver.h" | 15 #include "net/dns/mock_host_resolver.h" |
(...skipping 23 matching lines...) Expand all Loading... |
38 } | 39 } |
39 | 40 |
40 void AgentHostClosed( | 41 void AgentHostClosed( |
41 DevToolsAgentHost* agent_host, | 42 DevToolsAgentHost* agent_host, |
42 bool replaced_with_another_client) override { | 43 bool replaced_with_another_client) override { |
43 closed_ = true; | 44 closed_ = true; |
44 } | 45 } |
45 | 46 |
46 void WaitForReply() { | 47 void WaitForReply() { |
47 waiting_for_reply_ = true; | 48 waiting_for_reply_ = true; |
48 base::MessageLoop::current()->Run(); | 49 base::RunLoop().Run(); |
49 } | 50 } |
50 | 51 |
51 private: | 52 private: |
52 bool closed_; | 53 bool closed_; |
53 bool waiting_for_reply_; | 54 bool waiting_for_reply_; |
54 }; | 55 }; |
55 | 56 |
56 // Fails on Android, http://crbug.com/464993. | 57 // Fails on Android, http://crbug.com/464993. |
57 #if defined(OS_ANDROID) | 58 #if defined(OS_ANDROID) |
58 #define MAYBE_CrossSiteIframeAgentHost DISABLED_CrossSiteIframeAgentHost | 59 #define MAYBE_CrossSiteIframeAgentHost DISABLED_CrossSiteIframeAgentHost |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 DevToolsAgentHost::GetOrCreateFor(root->current_frame_host()); | 195 DevToolsAgentHost::GetOrCreateFor(root->current_frame_host()); |
195 EXPECT_NE(main_frame_agent.get(), child_frame_agent.get()); | 196 EXPECT_NE(main_frame_agent.get(), child_frame_agent.get()); |
196 | 197 |
197 // Agent for web contents should be the the main frame's one. | 198 // Agent for web contents should be the the main frame's one. |
198 scoped_refptr<DevToolsAgentHost> page_agent = | 199 scoped_refptr<DevToolsAgentHost> page_agent = |
199 DevToolsAgentHost::GetOrCreateFor(shell()->web_contents()); | 200 DevToolsAgentHost::GetOrCreateFor(shell()->web_contents()); |
200 EXPECT_EQ(page_agent.get(), main_frame_agent.get()); | 201 EXPECT_EQ(page_agent.get(), main_frame_agent.get()); |
201 } | 202 } |
202 | 203 |
203 } // namespace content | 204 } // namespace content |
OLD | NEW |