Chromium Code Reviews| 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" |
|
Devlin
2016/11/28 16:12:03
do we still need this? And separately we should a
| |
| 10 #include "content/public/browser/web_contents.h" | 10 #include "content/public/browser/web_contents.h" |
| 11 #include "content/public/test/mock_render_process_host.h" | 11 #include "content/public/test/mock_render_process_host.h" |
| 12 #include "content/public/test/web_contents_tester.h" | 12 #include "content/public/test/web_contents_tester.h" |
| 13 | 13 |
| 14 namespace extensions { | 14 namespace extensions { |
| 15 | 15 |
| 16 DeclarativeContentConditionTrackerTest::DeclarativeContentConditionTrackerTest() | 16 DeclarativeContentConditionTrackerTest::DeclarativeContentConditionTrackerTest() |
| 17 : profile_(new TestingProfile), | 17 : profile_(new TestingProfile), |
| 18 next_predicate_group_id_(1) { | 18 next_predicate_group_id_(1) { |
| 19 } | 19 } |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 33 nullptr)); | 33 nullptr)); |
| 34 content::RenderFrameHostTester::For(tab->GetMainFrame()) | 34 content::RenderFrameHostTester::For(tab->GetMainFrame()) |
| 35 ->InitializeRenderFrameIfNeeded(); | 35 ->InitializeRenderFrameIfNeeded(); |
| 36 return tab; | 36 return tab; |
| 37 } | 37 } |
| 38 | 38 |
| 39 content::MockRenderProcessHost* | 39 content::MockRenderProcessHost* |
| 40 DeclarativeContentConditionTrackerTest::GetMockRenderProcessHost( | 40 DeclarativeContentConditionTrackerTest::GetMockRenderProcessHost( |
| 41 content::WebContents* contents) { | 41 content::WebContents* contents) { |
| 42 return static_cast<content::MockRenderProcessHost*>( | 42 return static_cast<content::MockRenderProcessHost*>( |
| 43 contents->GetRenderViewHost()->GetProcess()); | 43 contents->GetMainFrame()->GetProcess()); |
| 44 } | 44 } |
| 45 | 45 |
| 46 const void* DeclarativeContentConditionTrackerTest::GeneratePredicateGroupID() { | 46 const void* DeclarativeContentConditionTrackerTest::GeneratePredicateGroupID() { |
| 47 // The group ID is opaque to the trackers. | 47 // The group ID is opaque to the trackers. |
| 48 return reinterpret_cast<const void*>(next_predicate_group_id_++); | 48 return reinterpret_cast<const void*>(next_predicate_group_id_++); |
| 49 } | 49 } |
| 50 | 50 |
| 51 } // namespace extensions | 51 } // namespace extensions |
| OLD | NEW |