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

Side by Side Diff: content/browser/site_instance_impl_unittest.cc

Issue 14335017: content: Use base::MessageLoop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 7 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 | Annotate | Revision Log
OLDNEW
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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/compiler_specific.h" 6 #include "base/compiler_specific.h"
7 #include "base/stl_util.h" 7 #include "base/stl_util.h"
8 #include "base/string16.h" 8 #include "base/string16.h"
9 #include "content/browser/browser_thread_impl.h" 9 #include "content/browser/browser_thread_impl.h"
10 #include "content/browser/browsing_instance.h" 10 #include "content/browser/browsing_instance.h"
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 } 116 }
117 117
118 void set_privileged_process_id(int process_id) { 118 void set_privileged_process_id(int process_id) {
119 browser_client_.set_privileged_process_id(process_id); 119 browser_client_.set_privileged_process_id(process_id);
120 } 120 }
121 121
122 void DrainMessageLoops() { 122 void DrainMessageLoops() {
123 // We don't just do this in TearDown() because we create TestBrowserContext 123 // We don't just do this in TearDown() because we create TestBrowserContext
124 // objects in each test, which will be destructed before 124 // objects in each test, which will be destructed before
125 // TearDown() is called. 125 // TearDown() is called.
126 MessageLoop::current()->RunUntilIdle(); 126 base::MessageLoop::current()->RunUntilIdle();
127 message_loop_.RunUntilIdle(); 127 message_loop_.RunUntilIdle();
128 } 128 }
129 129
130 private: 130 private:
131 MessageLoopForUI message_loop_; 131 base::MessageLoopForUI message_loop_;
132 TestBrowserThread ui_thread_; 132 TestBrowserThread ui_thread_;
133 TestBrowserThread file_user_blocking_thread_; 133 TestBrowserThread file_user_blocking_thread_;
134 TestBrowserThread io_thread_; 134 TestBrowserThread io_thread_;
135 135
136 SiteInstanceTestBrowserClient browser_client_; 136 SiteInstanceTestBrowserClient browser_client_;
137 ContentBrowserClient* old_browser_client_; 137 ContentBrowserClient* old_browser_client_;
138 }; 138 };
139 139
140 // Subclass of BrowsingInstance that updates a counter when deleted and 140 // Subclass of BrowsingInstance that updates a counter when deleted and
141 // returns TestSiteInstances from GetSiteInstanceForURL. 141 // returns TestSiteInstances from GetSiteInstanceForURL.
(...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after
754 EXPECT_TRUE(instance->GetSiteURL().is_empty()); 754 EXPECT_TRUE(instance->GetSiteURL().is_empty());
755 host.reset(instance->GetProcess()); 755 host.reset(instance->GetProcess());
756 756
757 EXPECT_FALSE(RenderProcessHostImpl::GetProcessHostForSite( 757 EXPECT_FALSE(RenderProcessHostImpl::GetProcessHostForSite(
758 browser_context.get(), GURL())); 758 browser_context.get(), GURL()));
759 759
760 DrainMessageLoops(); 760 DrainMessageLoops();
761 } 761 }
762 762
763 } // namespace content 763 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/resolve_proxy_msg_helper_unittest.cc ('k') | content/browser/speech/google_one_shot_remote_engine_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698