| OLD | NEW |
| 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/files/file_path.h" | 5 #include "base/files/file_path.h" |
| 6 #include "base/files/scoped_temp_dir.h" | 6 #include "base/files/scoped_temp_dir.h" |
| 7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 | 42 |
| 43 private: | 43 private: |
| 44 virtual ~MockDownloadFileObserver() {} | 44 virtual ~MockDownloadFileObserver() {} |
| 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 ~DragDownloadFileTest() override {} |
| 53 | 53 |
| 54 void Succeed() { | 54 void Succeed() { |
| 55 BrowserThread::PostTask(BrowserThread::UI, | 55 BrowserThread::PostTask(BrowserThread::UI, |
| 56 FROM_HERE, | 56 FROM_HERE, |
| 57 base::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 } |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 .WillOnce(InvokeWithoutArgs(this, &DragDownloadFileTest::Succeed)); | 129 .WillOnce(InvokeWithoutArgs(this, &DragDownloadFileTest::Succeed)); |
| 130 ON_CALL(*observer.get(), OnDownloadAborted()) | 130 ON_CALL(*observer.get(), OnDownloadAborted()) |
| 131 .WillByDefault(InvokeWithoutArgs(this, &DragDownloadFileTest::FailFast)); | 131 .WillByDefault(InvokeWithoutArgs(this, &DragDownloadFileTest::FailFast)); |
| 132 file->Start(observer.get()); | 132 file->Start(observer.get()); |
| 133 RunMessageLoop(); | 133 RunMessageLoop(); |
| 134 } | 134 } |
| 135 | 135 |
| 136 // TODO(benjhayden): Test Stop(). | 136 // TODO(benjhayden): Test Stop(). |
| 137 | 137 |
| 138 } // namespace content | 138 } // namespace content |
| OLD | NEW |