| 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/message_loop.h" | 5 #include "base/message_loop.h" |
| 6 #include "base/stl_util.h" | 6 #include "base/stl_util.h" |
| 7 #include "base/threading/thread.h" | 7 #include "base/threading/thread.h" |
| 8 #include "content/browser/download/byte_stream.h" | 8 #include "content/browser/download/byte_stream.h" |
| 9 #include "content/browser/download/download_create_info.h" | 9 #include "content/browser/download/download_create_info.h" |
| 10 #include "content/browser/download/download_file_factory.h" | 10 #include "content/browser/download/download_file_factory.h" |
| (...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 EXPECT_TRUE(observer.CheckUpdated()); | 415 EXPECT_TRUE(observer.CheckUpdated()); |
| 416 EXPECT_EQ(new_intermediate_path, item->GetFullPath()); | 416 EXPECT_EQ(new_intermediate_path, item->GetFullPath()); |
| 417 | 417 |
| 418 CleanupItem(item, download_file); | 418 CleanupItem(item, download_file); |
| 419 } | 419 } |
| 420 | 420 |
| 421 TEST_F(DownloadItemTest, NotificationAfterTogglePause) { | 421 TEST_F(DownloadItemTest, NotificationAfterTogglePause) { |
| 422 DownloadItemImpl* item = CreateDownloadItem(); | 422 DownloadItemImpl* item = CreateDownloadItem(); |
| 423 MockObserver observer(item); | 423 MockObserver observer(item); |
| 424 | 424 |
| 425 item->TogglePause(); | 425 item->Pause(); |
| 426 ASSERT_TRUE(observer.CheckUpdated()); | 426 ASSERT_TRUE(observer.CheckUpdated()); |
| 427 | 427 |
| 428 item->TogglePause(); | 428 ASSERT_TRUE(item->IsPaused()); |
| 429 |
| 430 item->Resume(); |
| 429 ASSERT_TRUE(observer.CheckUpdated()); | 431 ASSERT_TRUE(observer.CheckUpdated()); |
| 430 } | 432 } |
| 431 | 433 |
| 432 TEST_F(DownloadItemTest, DisplayName) { | 434 TEST_F(DownloadItemTest, DisplayName) { |
| 433 DownloadItemImpl* item = CreateDownloadItem(); | 435 DownloadItemImpl* item = CreateDownloadItem(); |
| 434 DownloadItemImplDelegate::DownloadTargetCallback callback; | 436 DownloadItemImplDelegate::DownloadTargetCallback callback; |
| 435 MockDownloadFile* download_file = | 437 MockDownloadFile* download_file = |
| 436 AddDownloadFileToDownloadItem(item, &callback); | 438 AddDownloadFileToDownloadItem(item, &callback); |
| 437 FilePath target_path(FilePath(kDummyPath).AppendASCII("foo.bar")); | 439 FilePath target_path(FilePath(kDummyPath).AppendASCII("foo.bar")); |
| 438 FilePath intermediate_path(target_path.InsertBeforeExtensionASCII("x")); | 440 FilePath intermediate_path(target_path.InsertBeforeExtensionASCII("x")); |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 718 ASSERT_TRUE(item->IsCancelled()); | 720 ASSERT_TRUE(item->IsCancelled()); |
| 719 EXPECT_FALSE(item->CanShowInFolder()); | 721 EXPECT_FALSE(item->CanShowInFolder()); |
| 720 EXPECT_FALSE(item->CanOpenDownload()); | 722 EXPECT_FALSE(item->CanOpenDownload()); |
| 721 } | 723 } |
| 722 | 724 |
| 723 TEST(MockDownloadItem, Compiles) { | 725 TEST(MockDownloadItem, Compiles) { |
| 724 MockDownloadItem mock_item; | 726 MockDownloadItem mock_item; |
| 725 } | 727 } |
| 726 | 728 |
| 727 } // namespace content | 729 } // namespace content |
| OLD | NEW |