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

Side by Side Diff: extensions/browser/value_store/value_store_frontend_unittest.cc

Issue 1389163008: Don't use base::MessageLoop::{Quit,QuitClosure} in extensions/, ipc/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/files/file_util.h" 5 #include "base/files/file_util.h"
6 #include "base/files/scoped_temp_dir.h" 6 #include "base/files/scoped_temp_dir.h"
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "content/public/test/test_browser_thread.h" 10 #include "content/public/test/test_browser_thread.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 storage_->Get(key, base::Bind(&ValueStoreFrontendTest::GetAndWait, 49 storage_->Get(key, base::Bind(&ValueStoreFrontendTest::GetAndWait,
50 base::Unretained(this), output)); 50 base::Unretained(this), output));
51 base::MessageLoop::current()->Run(); // wait for GetAndWait 51 base::MessageLoop::current()->Run(); // wait for GetAndWait
52 return !!output->get(); 52 return !!output->get();
53 } 53 }
54 54
55 protected: 55 protected:
56 void GetAndWait(scoped_ptr<base::Value>* output, 56 void GetAndWait(scoped_ptr<base::Value>* output,
57 scoped_ptr<base::Value> result) { 57 scoped_ptr<base::Value> result) {
58 *output = result.Pass(); 58 *output = result.Pass();
59 base::MessageLoop::current()->Quit(); 59 base::MessageLoop::current()->QuitWhenIdle();
60 } 60 }
61 61
62 scoped_ptr<ValueStoreFrontend> storage_; 62 scoped_ptr<ValueStoreFrontend> storage_;
63 base::ScopedTempDir temp_dir_; 63 base::ScopedTempDir temp_dir_;
64 base::FilePath db_path_; 64 base::FilePath db_path_;
65 base::MessageLoop message_loop_; 65 base::MessageLoop message_loop_;
66 content::TestBrowserThread ui_thread_; 66 content::TestBrowserThread ui_thread_;
67 content::TestBrowserThread file_thread_; 67 content::TestBrowserThread file_thread_;
68 }; 68 };
69 69
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 105
106 { 106 {
107 ASSERT_TRUE(Get("key1", &value)); 107 ASSERT_TRUE(Get("key1", &value));
108 std::string result; 108 std::string result;
109 ASSERT_TRUE(value->GetAsString(&result)); 109 ASSERT_TRUE(value->GetAsString(&result));
110 EXPECT_EQ("new1", result); 110 EXPECT_EQ("new1", result);
111 } 111 }
112 112
113 ASSERT_FALSE(Get("key2", &value)); 113 ASSERT_FALSE(Get("key2", &value));
114 } 114 }
OLDNEW
« no previous file with comments | « extensions/browser/image_loader_unittest.cc ('k') | extensions/shell/browser/shell_desktop_controller_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698