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

Side by Side Diff: chrome/browser/net/net_log_temp_file_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
« no previous file with comments | « chrome/browser/net/load_timing_browsertest.cc ('k') | chrome/browser/net/network_stats.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "chrome/browser/net/net_log_temp_file.h" 5 #include "chrome/browser/net/net_log_temp_file.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 VerifyNetExportLog(); 148 VerifyNetExportLog();
149 } 149 }
150 150
151 scoped_ptr<ChromeNetLog> net_log_; 151 scoped_ptr<ChromeNetLog> net_log_;
152 // |net_log_temp_file_| is initialized after |net_log_| so that it can stop 152 // |net_log_temp_file_| is initialized after |net_log_| so that it can stop
153 // obvserving on destruction. 153 // obvserving on destruction.
154 scoped_ptr<TestNetLogTempFile> net_log_temp_file_; 154 scoped_ptr<TestNetLogTempFile> net_log_temp_file_;
155 base::FilePath net_export_log_; 155 base::FilePath net_export_log_;
156 156
157 private: 157 private:
158 MessageLoop message_loop_; 158 base::MessageLoop message_loop_;
159 content::TestBrowserThread file_user_blocking_thread_; 159 content::TestBrowserThread file_user_blocking_thread_;
160 }; 160 };
161 161
162 TEST_F(NetLogTempFileTest, EnsureInitFailure) { 162 TEST_F(NetLogTempFileTest, EnsureInitFailure) {
163 net_log_temp_file_->set_lie_about_net_export_log_directory(true); 163 net_log_temp_file_->set_lie_about_net_export_log_directory(true);
164 164
165 EXPECT_FALSE(net_log_temp_file_->EnsureInit()); 165 EXPECT_FALSE(net_log_temp_file_->EnsureInit());
166 VerifyFilePathAndStateAfterEnsureInitFailure(); 166 VerifyFilePathAndStateAfterEnsureInitFailure();
167 167
168 net_log_temp_file_->ProcessCommand(NetLogTempFile::DO_START); 168 net_log_temp_file_->ProcessCommand(NetLogTempFile::DO_START);
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 // Log an event. 278 // Log an event.
279 net_log_->AddGlobalEntry(net::NetLog::TYPE_CANCELLED); 279 net_log_->AddGlobalEntry(net::NetLog::TYPE_CANCELLED);
280 280
281 net_log_temp_file_->ProcessCommand(NetLogTempFile::DO_STOP); 281 net_log_temp_file_->ProcessCommand(NetLogTempFile::DO_STOP);
282 VerifyFileAndStateAfterDoStop(); 282 VerifyFileAndStateAfterDoStop();
283 283
284 int64 new_stop_file_size; 284 int64 new_stop_file_size;
285 EXPECT_TRUE(file_util::GetFileSize(net_export_log_, &new_stop_file_size)); 285 EXPECT_TRUE(file_util::GetFileSize(net_export_log_, &new_stop_file_size));
286 EXPECT_GE(new_stop_file_size, stop_file_size); 286 EXPECT_GE(new_stop_file_size, stop_file_size);
287 } 287 }
OLDNEW
« no previous file with comments | « chrome/browser/net/load_timing_browsertest.cc ('k') | chrome/browser/net/network_stats.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698