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 "chrome/browser/extensions/api/declarative_content/declarative_content_
condition_tracker_test.h" | 5 #include "chrome/browser/extensions/api/declarative_content/declarative_content_
condition_tracker_test.h" |
6 | 6 |
7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
8 #include "chrome/test/base/testing_profile.h" | 8 #include "chrome/test/base/testing_profile.h" |
9 #include "content/public/browser/render_view_host.h" | 9 #include "content/public/browser/render_view_host.h" |
10 #include "content/public/browser/web_contents.h" | 10 #include "content/public/browser/web_contents.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 DeclarativeContentConditionTrackerTest:: | 21 DeclarativeContentConditionTrackerTest:: |
22 ~DeclarativeContentConditionTrackerTest() { | 22 ~DeclarativeContentConditionTrackerTest() { |
23 // MockRenderProcessHosts are deleted from the message loop, and their | 23 // MockRenderProcessHosts are deleted from the message loop, and their |
24 // deletion must complete before RenderViewHostTestEnabler's destructor is | 24 // deletion must complete before RenderViewHostTestEnabler's destructor is |
25 // run. | 25 // run. |
26 base::RunLoop().RunUntilIdle(); | 26 base::RunLoop().RunUntilIdle(); |
27 } | 27 } |
28 | 28 |
29 scoped_ptr<content::WebContents> | 29 scoped_ptr<content::WebContents> |
30 DeclarativeContentConditionTrackerTest::MakeTab() { | 30 DeclarativeContentConditionTrackerTest::MakeTab() { |
31 return make_scoped_ptr(content::WebContentsTester::CreateTestWebContents( | 31 scoped_ptr<content::WebContents> tab( |
32 profile_.get(), | 32 content::WebContentsTester::CreateTestWebContents(profile_.get(), |
33 nullptr)); | 33 nullptr)); |
| 34 content::RenderFrameHostTester::For(tab->GetMainFrame()) |
| 35 ->InitializeRenderFrameIfNeeded(); |
| 36 return tab; |
34 } | 37 } |
35 | 38 |
36 content::MockRenderProcessHost* | 39 content::MockRenderProcessHost* |
37 DeclarativeContentConditionTrackerTest::GetMockRenderProcessHost( | 40 DeclarativeContentConditionTrackerTest::GetMockRenderProcessHost( |
38 content::WebContents* contents) { | 41 content::WebContents* contents) { |
39 return static_cast<content::MockRenderProcessHost*>( | 42 return static_cast<content::MockRenderProcessHost*>( |
40 contents->GetRenderViewHost()->GetProcess()); | 43 contents->GetRenderViewHost()->GetProcess()); |
41 } | 44 } |
42 | 45 |
43 const void* DeclarativeContentConditionTrackerTest::GeneratePredicateGroupID() { | 46 const void* DeclarativeContentConditionTrackerTest::GeneratePredicateGroupID() { |
44 // The group ID is opaque to the trackers. | 47 // The group ID is opaque to the trackers. |
45 return reinterpret_cast<const void*>(next_predicate_group_id_++); | 48 return reinterpret_cast<const void*>(next_predicate_group_id_++); |
46 } | 49 } |
47 | 50 |
48 } // namespace extensions | 51 } // namespace extensions |
OLD | NEW |