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

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

Issue 2211473003: Remove calls to deprecated MessageLoop methods on Windows and Linux. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 4 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
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 "content/browser/site_instance_impl.h" 5 #include "content/browser/site_instance_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 131
132 void set_privileged_process_id(int process_id) { 132 void set_privileged_process_id(int process_id) {
133 browser_client_.set_privileged_process_id(process_id); 133 browser_client_.set_privileged_process_id(process_id);
134 } 134 }
135 135
136 void DrainMessageLoops() { 136 void DrainMessageLoops() {
137 // We don't just do this in TearDown() because we create TestBrowserContext 137 // We don't just do this in TearDown() because we create TestBrowserContext
138 // objects in each test, which will be destructed before 138 // objects in each test, which will be destructed before
139 // TearDown() is called. 139 // TearDown() is called.
140 base::RunLoop().RunUntilIdle(); 140 base::RunLoop().RunUntilIdle();
141 message_loop_.RunUntilIdle(); 141 base::RunLoop().RunUntilIdle();
fdoray 2016/08/04 18:48:21 Why are there 2 calls?
gab 2016/08/05 01:09:57 Probably because the developer thought he was flus
fdoray 2016/08/05 16:10:36 Done. https://codereview.chromium.org/2219053002/
142 } 142 }
143 143
144 SiteInstanceTestBrowserClient* browser_client() { return &browser_client_; } 144 SiteInstanceTestBrowserClient* browser_client() { return &browser_client_; }
145 145
146 private: 146 private:
147 base::MessageLoopForUI message_loop_; 147 base::MessageLoopForUI message_loop_;
148 TestBrowserThread ui_thread_; 148 TestBrowserThread ui_thread_;
149 TestBrowserThread file_user_blocking_thread_; 149 TestBrowserThread file_user_blocking_thread_;
150 TestBrowserThread io_thread_; 150 TestBrowserThread io_thread_;
151 151
(...skipping 689 matching lines...) Expand 10 before | Expand all | Expand 10 after
841 EXPECT_EQ(1, browser_client()->GetAndClearSiteInstanceDeleteCount()); 841 EXPECT_EQ(1, browser_client()->GetAndClearSiteInstanceDeleteCount());
842 EXPECT_EQ(0, browser_client()->GetAndClearBrowsingInstanceDeleteCount()); 842 EXPECT_EQ(0, browser_client()->GetAndClearBrowsingInstanceDeleteCount());
843 843
844 // Free the subframe instance, which should free the browsing instance. 844 // Free the subframe instance, which should free the browsing instance.
845 subframe_instance = nullptr; 845 subframe_instance = nullptr;
846 EXPECT_EQ(1, browser_client()->GetAndClearSiteInstanceDeleteCount()); 846 EXPECT_EQ(1, browser_client()->GetAndClearSiteInstanceDeleteCount());
847 EXPECT_EQ(1, browser_client()->GetAndClearBrowsingInstanceDeleteCount()); 847 EXPECT_EQ(1, browser_client()->GetAndClearBrowsingInstanceDeleteCount());
848 } 848 }
849 849
850 } // namespace content 850 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698