OLD | NEW |
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/safe_browsing/ui_manager.h" | 5 #include "chrome/browser/safe_browsing/ui_manager.h" |
6 | 6 |
7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
8 #include "chrome/browser/safe_browsing/safe_browsing_blocking_page.h" | 8 #include "chrome/browser/safe_browsing/safe_browsing_blocking_page.h" |
9 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | 9 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
10 #include "chrome/browser/safe_browsing/ui_manager.h" | 10 #include "chrome/browser/safe_browsing/ui_manager.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 private: | 63 private: |
64 bool callback_called_ = false; | 64 bool callback_called_ = false; |
65 bool proceed_ = false; | 65 bool proceed_ = false; |
66 base::RunLoop loop_; | 66 base::RunLoop loop_; |
67 }; | 67 }; |
68 | 68 |
69 class SafeBrowsingUIManagerTest : public ChromeRenderViewHostTestHarness { | 69 class SafeBrowsingUIManagerTest : public ChromeRenderViewHostTestHarness { |
70 public: | 70 public: |
71 SafeBrowsingUIManagerTest() : ui_manager_(new SafeBrowsingUIManager(NULL)) {} | 71 SafeBrowsingUIManagerTest() : ui_manager_(new SafeBrowsingUIManager(NULL)) {} |
72 | 72 |
73 ~SafeBrowsingUIManagerTest() override{}; | 73 ~SafeBrowsingUIManagerTest() override {} |
74 | 74 |
75 void SetUp() override { | 75 void SetUp() override { |
76 SetThreadBundleOptions(content::TestBrowserThreadBundle::REAL_IO_THREAD); | 76 SetThreadBundleOptions(content::TestBrowserThreadBundle::REAL_IO_THREAD); |
77 ChromeRenderViewHostTestHarness::SetUp(); | 77 ChromeRenderViewHostTestHarness::SetUp(); |
78 SafeBrowsingUIManager::CreateWhitelistForTesting(web_contents()); | 78 SafeBrowsingUIManager::CreateWhitelistForTesting(web_contents()); |
79 } | 79 } |
80 | 80 |
81 void TearDown() override { ChromeRenderViewHostTestHarness::TearDown(); } | 81 void TearDown() override { ChromeRenderViewHostTestHarness::TearDown(); } |
82 | 82 |
83 bool IsWhitelisted(security_interstitials::UnsafeResource resource) { | 83 bool IsWhitelisted(security_interstitials::UnsafeResource resource) { |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 SimulateBlockingPageDone(resources, true); | 414 SimulateBlockingPageDone(resources, true); |
415 EXPECT_TRUE(delegate.visible_security_state_changed()); | 415 EXPECT_TRUE(delegate.visible_security_state_changed()); |
416 | 416 |
417 waiter.WaitForCallback(); | 417 waiter.WaitForCallback(); |
418 EXPECT_TRUE(waiter.callback_called()); | 418 EXPECT_TRUE(waiter.callback_called()); |
419 EXPECT_TRUE(waiter.proceed()); | 419 EXPECT_TRUE(waiter.proceed()); |
420 EXPECT_TRUE(IsWhitelisted(resource)); | 420 EXPECT_TRUE(IsWhitelisted(resource)); |
421 } | 421 } |
422 | 422 |
423 } // namespace safe_browsing | 423 } // namespace safe_browsing |
OLD | NEW |