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

Side by Side Diff: chrome/browser/ui/webui/md_downloads/downloads_list_tracker_unittest.cc

Issue 2230203002: chrome: Use stl utilities from the base namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed accidental components/ change 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "chrome/browser/ui/webui/md_downloads/downloads_list_tracker.h" 5 #include "chrome/browser/ui/webui/md_downloads/downloads_list_tracker.h"
6 6
7 #include <limits.h> 7 #include <limits.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 }; 91 };
92 92
93 // A fixture to test DownloadsListTracker. 93 // A fixture to test DownloadsListTracker.
94 class DownloadsListTrackerTest : public testing::Test { 94 class DownloadsListTrackerTest : public testing::Test {
95 public: 95 public:
96 DownloadsListTrackerTest() {} 96 DownloadsListTrackerTest() {}
97 97
98 ~DownloadsListTrackerTest() override { 98 ~DownloadsListTrackerTest() override {
99 for (auto* mock_item : mock_items_) 99 for (auto* mock_item : mock_items_)
100 testing::Mock::VerifyAndClear(mock_item); 100 testing::Mock::VerifyAndClear(mock_item);
101 STLDeleteElements(&mock_items_); 101 base::STLDeleteElements(&mock_items_);
102 } 102 }
103 103
104 // testing::Test: 104 // testing::Test:
105 void SetUp() override { 105 void SetUp() override {
106 ON_CALL(manager_, GetBrowserContext()).WillByDefault(Return(&profile_)); 106 ON_CALL(manager_, GetBrowserContext()).WillByDefault(Return(&profile_));
107 ON_CALL(manager_, GetAllDownloads(_)).WillByDefault( 107 ON_CALL(manager_, GetAllDownloads(_)).WillByDefault(
108 testing::Invoke(this, &DownloadsListTrackerTest::GetAllDownloads)); 108 testing::Invoke(this, &DownloadsListTrackerTest::GetAllDownloads));
109 } 109 }
110 110
111 MockDownloadItem* CreateMock(uint64_t id, const base::Time& started) { 111 MockDownloadItem* CreateMock(uint64_t id, const base::Time& started) {
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 EXPECT_EQ(1u, GetIds(*web_ui()->call_data()[0]->arg2()).size()); 349 EXPECT_EQ(1u, GetIds(*web_ui()->call_data()[0]->arg2()).size());
350 350
351 DownloadItemModel(unsent_item).SetShouldShowInShelf(false); 351 DownloadItemModel(unsent_item).SetShouldShowInShelf(false);
352 tracker()->OnDownloadUpdated(manager(), unsent_item); 352 tracker()->OnDownloadUpdated(manager(), unsent_item);
353 EXPECT_EQ(1u, web_ui()->call_data().size()); 353 EXPECT_EQ(1u, web_ui()->call_data().size());
354 354
355 DownloadItemModel(unsent_item).SetShouldShowInShelf(true); 355 DownloadItemModel(unsent_item).SetShouldShowInShelf(true);
356 tracker()->OnDownloadUpdated(manager(), unsent_item); 356 tracker()->OnDownloadUpdated(manager(), unsent_item);
357 EXPECT_EQ(1u, web_ui()->call_data().size()); 357 EXPECT_EQ(1u, web_ui()->call_data().size());
358 } 358 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698