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

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

Issue 1896463003: WebUI: Add JavaScript lifecycle-control to WebUIMessageHandler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698