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

Unified Diff: chrome/browser/ui/webui/md_downloads/md_downloads_dom_handler_unittest.cc

Issue 1610483003: MD Downloads: check for removed files on page load (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/webui/md_downloads/md_downloads_dom_handler.cc ('k') | chrome/chrome_tests_unit.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/md_downloads/md_downloads_dom_handler_unittest.cc
diff --git a/chrome/browser/ui/webui/md_downloads/md_downloads_dom_handler_unittest.cc b/chrome/browser/ui/webui/md_downloads/md_downloads_dom_handler_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..54e9e586c775ab530325f25f98f766daf76eeed2
--- /dev/null
+++ b/chrome/browser/ui/webui/md_downloads/md_downloads_dom_handler_unittest.cc
@@ -0,0 +1,31 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/ui/webui/md_downloads/md_downloads_dom_handler.h"
+
+#include "chrome/test/base/testing_profile.h"
+#include "content/public/test/mock_download_manager.h"
+#include "content/public/test/test_browser_thread_bundle.h"
+#include "content/public/test/test_web_ui.h"
+#include "testing/gmock/include/gmock/gmock.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+TEST(MdDownloadsDOMHandlerTest, ChecksForRemovedFiles) {
+ content::TestBrowserThreadBundle thread_bundle;
+ TestingProfile profile;
+
+ testing::NiceMock<content::MockDownloadManager> manager;
+ ON_CALL(manager, GetBrowserContext()).WillByDefault(
+ testing::Return(&profile));
+
+ content::TestWebUI web_ui;
+
+ EXPECT_CALL(manager, CheckForHistoryFilesRemoval());
+ MdDownloadsDOMHandler handler(&manager, &web_ui);
+
+ testing::Mock::VerifyAndClear(&manager);
+
+ EXPECT_CALL(manager, CheckForHistoryFilesRemoval());
+ handler.RenderViewReused(nullptr);
+}
« no previous file with comments | « chrome/browser/ui/webui/md_downloads/md_downloads_dom_handler.cc ('k') | chrome/chrome_tests_unit.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698