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

Side by Side Diff: chrome/browser/browsing_data/browsing_data_file_system_helper_unittest.cc

Issue 14113053: chrome: Use base::MessageLoop. (Part 3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase again Created 7 years, 6 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 "testing/gtest/include/gtest/gtest.h" 5 #include "testing/gtest/include/gtest/gtest.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 profile_.reset(); 83 profile_.reset();
84 message_loop_.RunUntilIdle(); 84 message_loop_.RunUntilIdle();
85 } 85 }
86 86
87 TestingProfile* GetProfile() { 87 TestingProfile* GetProfile() {
88 return profile_.get(); 88 return profile_.get();
89 } 89 }
90 90
91 // Blocks on the current MessageLoop until Notify() is called. 91 // Blocks on the current MessageLoop until Notify() is called.
92 void BlockUntilNotified() { 92 void BlockUntilNotified() {
93 MessageLoop::current()->Run(); 93 base::MessageLoop::current()->Run();
94 } 94 }
95 95
96 // Unblocks the current MessageLoop. Should be called in response to some sort 96 // Unblocks the current MessageLoop. Should be called in response to some sort
97 // of async activity in a callback method. 97 // of async activity in a callback method.
98 void Notify() { 98 void Notify() {
99 MessageLoop::current()->Quit(); 99 base::MessageLoop::current()->Quit();
100 } 100 }
101 101
102 // Callback that should be executed in response to 102 // Callback that should be executed in response to
103 // fileapi::SandboxMountPointProvider::ValidateFileSystemRoot 103 // fileapi::SandboxMountPointProvider::ValidateFileSystemRoot
104 void ValidateFileSystemCallback(base::PlatformFileError error) { 104 void ValidateFileSystemCallback(base::PlatformFileError error) {
105 validate_file_system_result_ = error; 105 validate_file_system_result_ = error;
106 Notify(); 106 Notify();
107 } 107 }
108 108
109 // Calls fileapi::SandboxMountPointProvider::ValidateFileSystemRootAndGetURL 109 // Calls fileapi::SandboxMountPointProvider::ValidateFileSystemRootAndGetURL
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 base::PlatformFileError validate_file_system_result_; 190 base::PlatformFileError validate_file_system_result_;
191 ScopedFileSystemInfoList file_system_info_list_; 191 ScopedFileSystemInfoList file_system_info_list_;
192 192
193 scoped_refptr<BrowsingDataFileSystemHelper> helper_; 193 scoped_refptr<BrowsingDataFileSystemHelper> helper_;
194 scoped_refptr<CannedBrowsingDataFileSystemHelper> canned_helper_; 194 scoped_refptr<CannedBrowsingDataFileSystemHelper> canned_helper_;
195 195
196 private: 196 private:
197 // message_loop_, as well as all the threads associated with it must be 197 // message_loop_, as well as all the threads associated with it must be
198 // defined before profile_ to prevent explosions. The threads also must be 198 // defined before profile_ to prevent explosions. The threads also must be
199 // defined in the order they're listed here. Oh how I love C++. 199 // defined in the order they're listed here. Oh how I love C++.
200 MessageLoopForUI message_loop_; 200 base::MessageLoopForUI message_loop_;
201 content::TestBrowserThread ui_thread_; 201 content::TestBrowserThread ui_thread_;
202 content::TestBrowserThread db_thread_; 202 content::TestBrowserThread db_thread_;
203 content::TestBrowserThread webkit_thread_; 203 content::TestBrowserThread webkit_thread_;
204 content::TestBrowserThread file_thread_; 204 content::TestBrowserThread file_thread_;
205 content::TestBrowserThread file_user_blocking_thread_; 205 content::TestBrowserThread file_user_blocking_thread_;
206 content::TestBrowserThread io_thread_; 206 content::TestBrowserThread io_thread_;
207 scoped_ptr<TestingProfile> profile_; 207 scoped_ptr<TestingProfile> profile_;
208 208
209 // We don't own this pointer: don't delete it. 209 // We don't own this pointer: don't delete it.
210 fileapi::SandboxMountPointProvider* sandbox_; 210 fileapi::SandboxMountPointProvider* sandbox_;
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 // extension and devtools schemes. 315 // extension and devtools schemes.
316 TEST_F(BrowsingDataFileSystemHelperTest, IgnoreExtensionsAndDevTools) { 316 TEST_F(BrowsingDataFileSystemHelperTest, IgnoreExtensionsAndDevTools) {
317 ASSERT_TRUE(canned_helper_->empty()); 317 ASSERT_TRUE(canned_helper_->empty());
318 canned_helper_->AddFileSystem(kOriginExt, kTemporary, 0); 318 canned_helper_->AddFileSystem(kOriginExt, kTemporary, 0);
319 ASSERT_TRUE(canned_helper_->empty()); 319 ASSERT_TRUE(canned_helper_->empty());
320 canned_helper_->AddFileSystem(kOriginDevTools, kTemporary, 0); 320 canned_helper_->AddFileSystem(kOriginDevTools, kTemporary, 0);
321 ASSERT_TRUE(canned_helper_->empty()); 321 ASSERT_TRUE(canned_helper_->empty());
322 } 322 }
323 323
324 } // namespace 324 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698