Index: components/data_reduction_proxy/content/browser/data_reduction_proxy_ui_manager_unittest.cc |
diff --git a/components/data_reduction_proxy/content/browser/data_reduction_proxy_ui_manager_unittest.cc b/components/data_reduction_proxy/content/browser/data_reduction_proxy_ui_manager_unittest.cc |
index aac5b587619e36808bcb08b9ea9eb8cef3e41e22..4525fa9ddc515cf3eb90d33eeec52f2d44deb823 100644 |
--- a/components/data_reduction_proxy/content/browser/data_reduction_proxy_ui_manager_unittest.cc |
+++ b/components/data_reduction_proxy/content/browser/data_reduction_proxy_ui_manager_unittest.cc |
@@ -4,6 +4,8 @@ |
#include "components/data_reduction_proxy/content/browser/data_reduction_proxy_ui_manager.h" |
+#include <vector> |
+ |
#include "base/bind.h" |
#include "base/memory/ref_counted.h" |
#include "base/memory/scoped_ptr.h" |
@@ -41,6 +43,12 @@ class TestDataReductionProxyUIManager : public DataReductionProxyUIManager { |
return is_tab_closed_return_value_; |
} |
+ void ShowBlockingPage(const BypassResource& resource) override { |
+ std::vector<BypassResource> resources; |
+ resources.push_back(resource); |
+ OnBlockingPageDone(resources, true); |
+ } |
+ |
bool is_tab_closed_return_value_; |
private: |
@@ -138,27 +146,29 @@ TEST_F(DataReductionProxyUIManagerTest, DontDisplayBlockingPage) { |
// Tests that OnBlockingPageDone calls the callback of the resource. |
TEST_F(DataReductionProxyUIManagerTest, OnBlockingPageDone) { |
DataReductionProxyUIManager::BypassResource resource; |
- resource.is_subresource = false; |
- resource.callback = base::Bind( |
- &DataReductionProxyUIManagerTest::OnBlockingPageDoneCallback, |
- base::Unretained(this)); |
- resource.render_process_host_id = 0; |
- resource.render_view_id = 0; |
- |
- content::BrowserThread::PostTask( |
- content::BrowserThread::UI, FROM_HERE, |
- base::Bind(&DataReductionProxyUIManager::OnBlockingPageDone, |
- ui_manager_, resource, false)); |
- base::RunLoop().RunUntilIdle(); |
- EXPECT_EQ(DONT_PROCEED, state_); |
- |
- ResetState(); |
- content::BrowserThread::PostTask( |
- content::BrowserThread::UI, FROM_HERE, |
- base::Bind(&DataReductionProxyUIManager::OnBlockingPageDone, |
- ui_manager_, resource, true)); |
- base::RunLoop().RunUntilIdle(); |
- EXPECT_EQ(PROCEED, state_); |
+ resource.is_subresource = false; |
+ resource.callback = base::Bind( |
+ &DataReductionProxyUIManagerTest::OnBlockingPageDoneCallback, |
+ base::Unretained(this)); |
+ resource.render_process_host_id = 0; |
+ resource.render_view_id = 0; |
+ std::vector<DataReductionProxyUIManager::BypassResource> resources; |
+ resources.push_back(resource); |
+ |
+ content::BrowserThread::PostTask( |
+ content::BrowserThread::UI, FROM_HERE, |
+ base::Bind(&DataReductionProxyUIManager::OnBlockingPageDone, |
+ ui_manager_, resources, false)); |
+ base::RunLoop().RunUntilIdle(); |
+ EXPECT_EQ(DONT_PROCEED, state_); |
+ |
+ ResetState(); |
+ content::BrowserThread::PostTask( |
+ content::BrowserThread::UI, FROM_HERE, |
+ base::Bind(&DataReductionProxyUIManager::OnBlockingPageDone, |
+ ui_manager_, resources, true)); |
+ base::RunLoop().RunUntilIdle(); |
+ EXPECT_EQ(PROCEED, state_); |
} |
} // namespace data_reduction_proxy |