| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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/md_downloads_dom_handler.h" | 5 #include "chrome/browser/ui/webui/md_downloads/md_downloads_dom_handler.h" |
| 6 | 6 |
| 7 #include "chrome/test/base/testing_profile.h" | 7 #include "chrome/test/base/testing_profile.h" |
| 8 #include "content/public/test/mock_download_manager.h" | 8 #include "content/public/test/mock_download_manager.h" |
| 9 #include "content/public/test/test_browser_thread_bundle.h" | 9 #include "content/public/test/test_browser_thread_bundle.h" |
| 10 #include "content/public/test/test_web_ui.h" | 10 #include "content/public/test/test_web_ui.h" |
| 11 #include "testing/gmock/include/gmock/gmock.h" | 11 #include "testing/gmock/include/gmock/gmock.h" |
| 12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
| 13 | 13 |
| 14 TEST(MdDownloadsDOMHandlerTest, ChecksForRemovedFiles) { | 14 TEST(MdDownloadsDOMHandlerTest, ChecksForRemovedFiles) { |
| 15 content::TestBrowserThreadBundle thread_bundle; | 15 content::TestBrowserThreadBundle thread_bundle; |
| 16 TestingProfile profile; | 16 TestingProfile profile; |
| 17 | 17 |
| 18 testing::NiceMock<content::MockDownloadManager> manager; | 18 testing::NiceMock<content::MockDownloadManager> manager; |
| 19 ON_CALL(manager, GetBrowserContext()).WillByDefault( | 19 ON_CALL(manager, GetBrowserContext()).WillByDefault( |
| 20 testing::Return(&profile)); | 20 testing::Return(&profile)); |
| 21 | 21 |
| 22 content::TestWebUI web_ui; | 22 content::TestWebUI web_ui; |
| 23 | 23 |
| 24 EXPECT_CALL(manager, CheckForHistoryFilesRemoval()); | 24 EXPECT_CALL(manager, CheckForHistoryFilesRemoval()); |
| 25 MdDownloadsDOMHandler handler(&manager, &web_ui); | 25 MdDownloadsDOMHandler handler(&manager, &web_ui); |
| 26 | 26 |
| 27 testing::Mock::VerifyAndClear(&manager); | 27 testing::Mock::VerifyAndClear(&manager); |
| 28 | 28 |
| 29 EXPECT_CALL(manager, CheckForHistoryFilesRemoval()); | 29 EXPECT_CALL(manager, CheckForHistoryFilesRemoval()); |
| 30 handler.RenderViewReused(); | 30 handler.OnJavascriptDisallowed(); |
| 31 } | 31 } |
| OLD | NEW |