| OLD | NEW | 
|---|
| 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/files/file_util.h" | 9 #include "base/files/file_util.h" | 
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" | 
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 80     return profile_.get(); | 80     return profile_.get(); | 
| 81   } | 81   } | 
| 82 | 82 | 
| 83   // Blocks on the current MessageLoop until Notify() is called. | 83   // Blocks on the current MessageLoop until Notify() is called. | 
| 84   void BlockUntilNotified() { | 84   void BlockUntilNotified() { | 
| 85     base::MessageLoop::current()->Run(); | 85     base::MessageLoop::current()->Run(); | 
| 86   } | 86   } | 
| 87 | 87 | 
| 88   // Unblocks the current MessageLoop. Should be called in response to some sort | 88   // Unblocks the current MessageLoop. Should be called in response to some sort | 
| 89   // of async activity in a callback method. | 89   // of async activity in a callback method. | 
| 90   void Notify() { | 90   void Notify() { base::MessageLoop::current()->QuitWhenIdle(); } | 
| 91     base::MessageLoop::current()->Quit(); |  | 
| 92   } |  | 
| 93 | 91 | 
| 94   // Callback that should be executed in response to | 92   // Callback that should be executed in response to | 
| 95   // storage::FileSystemContext::OpenFileSystem. | 93   // storage::FileSystemContext::OpenFileSystem. | 
| 96   void OpenFileSystemCallback(const GURL& root, | 94   void OpenFileSystemCallback(const GURL& root, | 
| 97                               const std::string& name, | 95                               const std::string& name, | 
| 98                               base::File::Error error) { | 96                               base::File::Error error) { | 
| 99     open_file_system_result_ = error; | 97     open_file_system_result_ = error; | 
| 100     Notify(); | 98     Notify(); | 
| 101   } | 99   } | 
| 102 | 100 | 
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 297 // extension and devtools schemes. | 295 // extension and devtools schemes. | 
| 298 TEST_F(BrowsingDataFileSystemHelperTest, IgnoreExtensionsAndDevTools) { | 296 TEST_F(BrowsingDataFileSystemHelperTest, IgnoreExtensionsAndDevTools) { | 
| 299   ASSERT_TRUE(canned_helper_->empty()); | 297   ASSERT_TRUE(canned_helper_->empty()); | 
| 300   canned_helper_->AddFileSystem(kOriginExt, kTemporary, 0); | 298   canned_helper_->AddFileSystem(kOriginExt, kTemporary, 0); | 
| 301   ASSERT_TRUE(canned_helper_->empty()); | 299   ASSERT_TRUE(canned_helper_->empty()); | 
| 302   canned_helper_->AddFileSystem(kOriginDevTools, kTemporary, 0); | 300   canned_helper_->AddFileSystem(kOriginDevTools, kTemporary, 0); | 
| 303   ASSERT_TRUE(canned_helper_->empty()); | 301   ASSERT_TRUE(canned_helper_->empty()); | 
| 304 } | 302 } | 
| 305 | 303 | 
| 306 }  // namespace | 304 }  // namespace | 
| OLD | NEW | 
|---|