| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // This test uses the safebrowsing test server published at | 5 // This test uses the safebrowsing test server published at |
| 6 // http://code.google.com/p/google-safe-browsing/ to test the safebrowsing | 6 // http://code.google.com/p/google-safe-browsing/ to test the safebrowsing |
| 7 // protocol implemetation. Details of the safebrowsing testing flow is | 7 // protocol implemetation. Details of the safebrowsing testing flow is |
| 8 // documented at | 8 // documented at |
| 9 // http://code.google.com/p/google-safe-browsing/wiki/ProtocolTesting | 9 // http://code.google.com/p/google-safe-browsing/wiki/ProtocolTesting |
| 10 // | 10 // |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 SafeBrowsingService* CreateSafeBrowsingService() override { | 141 SafeBrowsingService* CreateSafeBrowsingService() override { |
| 142 return new FakeSafeBrowsingService(url_prefix_); | 142 return new FakeSafeBrowsingService(url_prefix_); |
| 143 } | 143 } |
| 144 | 144 |
| 145 private: | 145 private: |
| 146 std::string url_prefix_; | 146 std::string url_prefix_; |
| 147 }; | 147 }; |
| 148 | 148 |
| 149 } // namespace | 149 } // namespace |
| 150 | 150 |
| 151 namespace safe_browsing { |
| 152 |
| 151 // This starts the browser and keeps status of states related to SafeBrowsing. | 153 // This starts the browser and keeps status of states related to SafeBrowsing. |
| 152 class SafeBrowsingServerTest : public InProcessBrowserTest { | 154 class SafeBrowsingServerTest : public InProcessBrowserTest { |
| 153 public: | 155 public: |
| 154 SafeBrowsingServerTest() | 156 SafeBrowsingServerTest() |
| 155 : safe_browsing_service_(NULL), | 157 : safe_browsing_service_(NULL), |
| 156 is_database_ready_(true), | 158 is_database_ready_(true), |
| 157 is_update_scheduled_(false), | 159 is_update_scheduled_(false), |
| 158 is_checked_url_in_db_(false), | 160 is_checked_url_in_db_(false), |
| 159 is_checked_url_safe_(false) { | 161 is_checked_url_safe_(false) { |
| 160 } | 162 } |
| (...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 571 safe_browsing_helper->FetchDBToVerify(test_server(), step)); | 573 safe_browsing_helper->FetchDBToVerify(test_server(), step)); |
| 572 EXPECT_GT(safe_browsing_helper->response_data().size(), 0U); | 574 EXPECT_GT(safe_browsing_helper->response_data().size(), 0U); |
| 573 last_step = step; | 575 last_step = step; |
| 574 } | 576 } |
| 575 | 577 |
| 576 // Verifies with server if test is done and waits till server responses. | 578 // Verifies with server if test is done and waits till server responses. |
| 577 EXPECT_EQ(net::URLRequestStatus::SUCCESS, | 579 EXPECT_EQ(net::URLRequestStatus::SUCCESS, |
| 578 safe_browsing_helper->VerifyTestComplete(test_server(), last_step)); | 580 safe_browsing_helper->VerifyTestComplete(test_server(), last_step)); |
| 579 EXPECT_EQ("yes", safe_browsing_helper->response_data()); | 581 EXPECT_EQ("yes", safe_browsing_helper->response_data()); |
| 580 } | 582 } |
| 583 |
| 584 } // namespace safe_browsing |
| OLD | NEW |