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

Side by Side Diff: chrome/browser/google_apis/base_operations_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 "chrome/browser/google_apis/base_operations.h" 5 #include "chrome/browser/google_apis/base_operations.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 virtual void SetUp() OVERRIDE { 66 virtual void SetUp() OVERRIDE {
67 profile_.reset(new TestingProfile); 67 profile_.reset(new TestingProfile);
68 runner_.reset(new OperationRunner(profile_.get(), 68 runner_.reset(new OperationRunner(profile_.get(),
69 NULL /* url_request_context_getter */, 69 NULL /* url_request_context_getter */,
70 std::vector<std::string>() /* scopes */, 70 std::vector<std::string>() /* scopes */,
71 std::string() /* custom user agent */)); 71 std::string() /* custom user agent */));
72 runner_->Initialize(); 72 runner_->Initialize();
73 LOG(ERROR) << "Initialized."; 73 LOG(ERROR) << "Initialized.";
74 } 74 }
75 75
76 MessageLoopForUI message_loop_; 76 base::MessageLoopForUI message_loop_;
77 content::TestBrowserThread ui_thread_; 77 content::TestBrowserThread ui_thread_;
78 scoped_ptr<TestingProfile> profile_; 78 scoped_ptr<TestingProfile> profile_;
79 scoped_ptr<OperationRunner> runner_; 79 scoped_ptr<OperationRunner> runner_;
80 80
81 // Following members stores data returned with callbacks to be verified 81 // Following members stores data returned with callbacks to be verified
82 // by tests. 82 // by tests.
83 scoped_ptr<base::Value> parse_json_result_; 83 scoped_ptr<base::Value> parse_json_result_;
84 bool parse_json_callback_called_; 84 bool parse_json_callback_called_;
85 GDataErrorCode get_data_result_error_; 85 GDataErrorCode get_data_result_error_;
86 scoped_ptr<base::Value> get_data_result_value_; 86 scoped_ptr<base::Value> get_data_result_value_;
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 // Should wait for a blocking pool task, as the JSON parsing is done in the 148 // Should wait for a blocking pool task, as the JSON parsing is done in the
149 // blocking pool. 149 // blocking pool.
150 test_util::RunBlockingPoolTask(); 150 test_util::RunBlockingPoolTask();
151 151
152 ASSERT_TRUE(get_data_callback_called_); 152 ASSERT_TRUE(get_data_callback_called_);
153 ASSERT_EQ(GDATA_PARSE_ERROR, get_data_result_error_); 153 ASSERT_EQ(GDATA_PARSE_ERROR, get_data_result_error_);
154 ASSERT_FALSE(get_data_result_value_.get()); 154 ASSERT_FALSE(get_data_result_value_.get());
155 } 155 }
156 156
157 } // namespace google_apis 157 } // namespace google_apis
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698