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

Side by Side Diff: content/browser/download/drag_download_file_browsertest.cc

Issue 14335017: content: Use base::MessageLoop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 7 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 "base/file_util.h" 5 #include "base/file_util.h"
6 #include "base/files/file_path.h" 6 #include "base/files/file_path.h"
7 #include "base/files/scoped_temp_dir.h" 7 #include "base/files/scoped_temp_dir.h"
8 #include "content/browser/download/download_file_factory.h" 8 #include "content/browser/download/download_file_factory.h"
9 #include "content/browser/download/download_file_impl.h" 9 #include "content/browser/download/download_file_impl.h"
10 #include "content/browser/download/download_item_impl.h" 10 #include "content/browser/download/download_item_impl.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 45
46 DISALLOW_COPY_AND_ASSIGN(MockDownloadFileObserver); 46 DISALLOW_COPY_AND_ASSIGN(MockDownloadFileObserver);
47 }; 47 };
48 48
49 class DragDownloadFileTest : public ContentBrowserTest { 49 class DragDownloadFileTest : public ContentBrowserTest {
50 public: 50 public:
51 DragDownloadFileTest() {} 51 DragDownloadFileTest() {}
52 virtual ~DragDownloadFileTest() {} 52 virtual ~DragDownloadFileTest() {}
53 53
54 void Succeed() { 54 void Succeed() {
55 BrowserThread::PostTask( 55 BrowserThread::PostTask(BrowserThread::UI,
56 BrowserThread::UI, FROM_HERE, 56 FROM_HERE,
57 MessageLoopForUI::current()->QuitClosure()); 57 base::MessageLoopForUI::current()->QuitClosure());
58 } 58 }
59 59
60 void FailFast() { 60 void FailFast() {
61 CHECK(false); 61 CHECK(false);
62 } 62 }
63 63
64 protected: 64 protected:
65 virtual void SetUpOnMainThread() OVERRIDE { 65 virtual void SetUpOnMainThread() OVERRIDE {
66 ASSERT_TRUE(downloads_directory_.CreateUniqueTempDir()); 66 ASSERT_TRUE(downloads_directory_.CreateUniqueTempDir());
67 ShellDownloadManagerDelegate* delegate = 67 ShellDownloadManagerDelegate* delegate =
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 this, &DragDownloadFileTest::Succeed)); 126 this, &DragDownloadFileTest::Succeed));
127 ON_CALL(*observer, OnDownloadAborted()).WillByDefault(InvokeWithoutArgs( 127 ON_CALL(*observer, OnDownloadAborted()).WillByDefault(InvokeWithoutArgs(
128 this, &DragDownloadFileTest::FailFast)); 128 this, &DragDownloadFileTest::FailFast));
129 file->Start(observer); 129 file->Start(observer);
130 RunMessageLoop(); 130 RunMessageLoop();
131 } 131 }
132 132
133 // TODO(benjhayden): Test Stop(). 133 // TODO(benjhayden): Test Stop().
134 134
135 } // namespace content 135 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/download/drag_download_file.cc ('k') | content/browser/download/mhtml_generation_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698