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

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

Issue 2211473003: Remove calls to deprecated MessageLoop methods on Windows and Linux. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Restore site_instance_impl_unittest.cc and suggestions_service_unittest.cc Created 4 years, 4 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
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 "content/browser/download/download_manager_impl.h" 5 #include "content/browser/download/download_manager_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
11 #include <set> 11 #include <set>
12 #include <string> 12 #include <string>
13 #include <utility> 13 #include <utility>
14 14
15 #include "base/bind.h" 15 #include "base/bind.h"
16 #include "base/files/scoped_temp_dir.h" 16 #include "base/files/scoped_temp_dir.h"
17 #include "base/guid.h" 17 #include "base/guid.h"
18 #include "base/macros.h" 18 #include "base/macros.h"
19 #include "base/memory/weak_ptr.h" 19 #include "base/memory/weak_ptr.h"
20 #include "base/message_loop/message_loop.h" 20 #include "base/message_loop/message_loop.h"
21 #include "base/run_loop.h"
21 #include "base/stl_util.h" 22 #include "base/stl_util.h"
22 #include "base/strings/string16.h" 23 #include "base/strings/string16.h"
23 #include "base/strings/string_util.h" 24 #include "base/strings/string_util.h"
24 #include "base/strings/utf_string_conversions.h" 25 #include "base/strings/utf_string_conversions.h"
25 #include "build/build_config.h" 26 #include "build/build_config.h"
26 #include "content/browser/byte_stream.h" 27 #include "content/browser/byte_stream.h"
27 #include "content/browser/download/download_create_info.h" 28 #include "content/browser/download/download_create_info.h"
28 #include "content/browser/download/download_file_factory.h" 29 #include "content/browser/download/download_file_factory.h"
29 #include "content/browser/download/download_item_factory.h" 30 #include "content/browser/download/download_item_factory.h"
30 #include "content/browser/download/download_item_impl.h" 31 #include "content/browser/download/download_item_impl.h"
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after
534 while (MockDownloadItemImpl* 535 while (MockDownloadItemImpl*
535 item = mock_download_item_factory_->PopItem()) { 536 item = mock_download_item_factory_->PopItem()) {
536 EXPECT_CALL(*item, GetState()) 537 EXPECT_CALL(*item, GetState())
537 .WillOnce(Return(DownloadItem::CANCELLED)); 538 .WillOnce(Return(DownloadItem::CANCELLED));
538 } 539 }
539 EXPECT_CALL(GetMockObserver(), ManagerGoingDown(download_manager_.get())) 540 EXPECT_CALL(GetMockObserver(), ManagerGoingDown(download_manager_.get()))
540 .WillOnce(Return()); 541 .WillOnce(Return());
541 542
542 download_manager_->Shutdown(); 543 download_manager_->Shutdown();
543 download_manager_.reset(); 544 download_manager_.reset();
544 message_loop_.RunUntilIdle(); 545 base::RunLoop().RunUntilIdle();
545 ASSERT_EQ(NULL, mock_download_item_factory_.get()); 546 ASSERT_FALSE(mock_download_item_factory_.get());
gab 2016/08/05 16:18:42 No .get()
546 ASSERT_EQ(NULL, mock_download_file_factory_.get());
547 message_loop_.RunUntilIdle();
548 mock_download_manager_delegate_.reset(); 547 mock_download_manager_delegate_.reset();
549 mock_browser_context_.reset(); 548 mock_browser_context_.reset();
550 download_urls_.clear(); 549 download_urls_.clear();
551 } 550 }
552 551
553 // Returns download id. 552 // Returns download id.
554 MockDownloadItemImpl& AddItemToManager() { 553 MockDownloadItemImpl& AddItemToManager() {
555 DownloadCreateInfo info; 554 DownloadCreateInfo info;
556 555
557 // Args are ignored except for download id, so everything else can be 556 // Args are ignored except for download id, so everything else can be
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
787 EXPECT_CALL(GetMockDownloadItem(1), Remove()).Times(0); 786 EXPECT_CALL(GetMockDownloadItem(1), Remove()).Times(0);
788 787
789 base::Callback<bool(const GURL&)> url_filter = 788 base::Callback<bool(const GURL&)> url_filter =
790 GetSingleURLFilter(download_urls_[0]); 789 GetSingleURLFilter(download_urls_[0]);
791 int remove_count = download_manager_->RemoveDownloadsByURLAndTime( 790 int remove_count = download_manager_->RemoveDownloadsByURLAndTime(
792 url_filter, base::Time(), base::Time::Max()); 791 url_filter, base::Time(), base::Time::Max());
793 EXPECT_EQ(remove_count, 1); 792 EXPECT_EQ(remove_count, 1);
794 } 793 }
795 794
796 } // namespace content 795 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698