Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(830)

Side by Side Diff: chrome/browser/extensions/api/declarative_content/declarative_content_condition_tracker_test.cc

Issue 1534933002: Don't process messages sent to dead routing ids. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More unittest fixes. Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/web_applications/web_app_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/web_applications/web_app_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698