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

Side by Side Diff: chrome/browser/spellchecker/feedback_sender_unittest.cc

Issue 1086733002: Ensure tests have an active task runner (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 5 years, 8 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 // Unit tests for |FeedbackSender| object. 5 // Unit tests for |FeedbackSender| object.
6 6
7 #include "chrome/browser/spellchecker/feedback_sender.h" 7 #include "chrome/browser/spellchecker/feedback_sender.h"
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 134
135 std::string GetUploadData() const { 135 std::string GetUploadData() const {
136 const net::TestURLFetcher* fetcher = 136 const net::TestURLFetcher* fetcher =
137 fetchers_.GetFetcherByID(kUrlFetcherId); 137 fetchers_.GetFetcherByID(kUrlFetcherId);
138 return fetcher ? fetcher->upload_data() : std::string(); 138 return fetcher ? fetcher->upload_data() : std::string();
139 } 139 }
140 140
141 scoped_ptr<spellcheck::FeedbackSender> feedback_; 141 scoped_ptr<spellcheck::FeedbackSender> feedback_;
142 142
143 private: 143 private:
144 base::MessageLoop loop_;
144 TestingProfile profile_; 145 TestingProfile profile_;
145 base::MessageLoop loop_;
146 content::TestBrowserThread ui_thread_; 146 content::TestBrowserThread ui_thread_;
147 scoped_ptr<base::FieldTrialList> field_trial_list_; 147 scoped_ptr<base::FieldTrialList> field_trial_list_;
148 scoped_refptr<base::FieldTrial> field_trial_; 148 scoped_refptr<base::FieldTrial> field_trial_;
149 net::TestURLFetcherFactory fetchers_; 149 net::TestURLFetcherFactory fetchers_;
150 }; 150 };
151 151
152 // Do not send data if there's no feedback. 152 // Do not send data if there's no feedback.
153 TEST_F(FeedbackSenderTest, NoFeedback) { 153 TEST_F(FeedbackSenderTest, NoFeedback) {
154 EXPECT_FALSE(IsUploadingData()); 154 EXPECT_FALSE(IsUploadingData());
155 feedback_->OnReceiveDocumentMarkers(kRendererProcessId, 155 feedback_->OnReceiveDocumentMarkers(kRendererProcessId,
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after
615 AddPendingFeedback(); 615 AddPendingFeedback();
616 feedback_->OnReceiveDocumentMarkers(kRendererProcessId, 616 feedback_->OnReceiveDocumentMarkers(kRendererProcessId,
617 std::vector<uint32>()); 617 std::vector<uint32>());
618 feedback_->StartFeedbackCollection(); 618 feedback_->StartFeedbackCollection();
619 feedback_->OnReceiveDocumentMarkers(kRendererProcessId, 619 feedback_->OnReceiveDocumentMarkers(kRendererProcessId,
620 std::vector<uint32>()); 620 std::vector<uint32>());
621 EXPECT_FALSE(IsUploadingData()); 621 EXPECT_FALSE(IsUploadingData());
622 } 622 }
623 623
624 } // namespace spellcheck 624 } // namespace spellcheck
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698