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

Side by Side Diff: webkit/fileapi/file_system_dir_url_request_job_unittest.cc

Issue 8991001: base::Bind: Convert most of webkit/appcache. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Clang fix. Created 9 years 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 // NOTE: These tests are run as part of "unit_tests" (in chrome/test/unit) 5 // NOTE: These tests are run as part of "unit_tests" (in chrome/test/unit)
6 // rather than as part of test_shell_tests because they rely on being able 6 // rather than as part of test_shell_tests because they rely on being able
7 // to instantiate a MessageLoop of type TYPE_IO. test_shell_tests uses 7 // to instantiate a MessageLoop of type TYPE_IO. test_shell_tests uses
8 // TYPE_UI, which URLRequest doesn't allow. 8 // TYPE_UI, which URLRequest doesn't allow.
9 // 9 //
10 10
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 EXPECT_EQ(net::ERR_FILE_NOT_FOUND, request_->status().error()); 274 EXPECT_EQ(net::ERR_FILE_NOT_FOUND, request_->status().error());
275 } 275 }
276 276
277 TEST_F(FileSystemDirURLRequestJobTest, NoSuchDirectory) { 277 TEST_F(FileSystemDirURLRequestJobTest, NoSuchDirectory) {
278 TestRequest(CreateFileSystemURL("somedir/")); 278 TestRequest(CreateFileSystemURL("somedir/"));
279 ASSERT_FALSE(request_->is_pending()); 279 ASSERT_FALSE(request_->is_pending());
280 ASSERT_FALSE(request_->status().is_success()); 280 ASSERT_FALSE(request_->status().is_success());
281 EXPECT_EQ(net::ERR_FILE_NOT_FOUND, request_->status().error()); 281 EXPECT_EQ(net::ERR_FILE_NOT_FOUND, request_->status().error());
282 } 282 }
283 283
284 class QuitNowTask : public Task {
285 public:
286 virtual void Run() {
287 MessageLoop::current()->QuitNow();
288 }
289 };
290
291 TEST_F(FileSystemDirURLRequestJobTest, Cancel) { 284 TEST_F(FileSystemDirURLRequestJobTest, Cancel) {
292 CreateDirectory("foo"); 285 CreateDirectory("foo");
293 TestRequestNoRun(CreateFileSystemURL("foo/")); 286 TestRequestNoRun(CreateFileSystemURL("foo/"));
294 // Run StartAsync() and only StartAsync(). 287 // Run StartAsync() and only StartAsync().
295 MessageLoop::current()->PostTask(FROM_HERE, new QuitNowTask); 288 MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure());
awong 2011/12/20 23:51:47 This is a behavior change...I think it breaks the
James Hawkins 2011/12/21 00:43:08 Done.
296 MessageLoop::current()->Run(); 289 MessageLoop::current()->Run();
297 290
298 request_.reset(); 291 request_.reset();
299 MessageLoop::current()->RunAllPending(); 292 MessageLoop::current()->RunAllPending();
300 // If we get here, success! we didn't crash! 293 // If we get here, success! we didn't crash!
301 } 294 }
302 295
303 } // namespace (anonymous) 296 } // namespace (anonymous)
304 } // namespace fileapi 297 } // namespace fileapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698