OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/ui/webui/md_downloads/md_downloads_dom_handler.h" |
| 6 |
| 7 #include "chrome/test/base/testing_profile.h" |
| 8 #include "content/public/test/mock_download_manager.h" |
| 9 #include "content/public/test/test_browser_thread_bundle.h" |
| 10 #include "content/public/test/test_web_ui.h" |
| 11 #include "testing/gmock/include/gmock/gmock.h" |
| 12 #include "testing/gtest/include/gtest/gtest.h" |
| 13 |
| 14 TEST(MdDownloadsDOMHandlerTest, ChecksForRemovedFiles) { |
| 15 content::TestBrowserThreadBundle thread_bundle; |
| 16 TestingProfile profile; |
| 17 |
| 18 testing::NiceMock<content::MockDownloadManager> manager; |
| 19 ON_CALL(manager, GetBrowserContext()).WillByDefault( |
| 20 testing::Return(&profile)); |
| 21 |
| 22 content::TestWebUI web_ui; |
| 23 |
| 24 EXPECT_CALL(manager, CheckForHistoryFilesRemoval()); |
| 25 MdDownloadsDOMHandler handler(&manager, &web_ui); |
| 26 |
| 27 testing::Mock::VerifyAndClear(&manager); |
| 28 |
| 29 EXPECT_CALL(manager, CheckForHistoryFilesRemoval()); |
| 30 handler.RenderViewReused(nullptr); |
| 31 } |
OLD | NEW |