| 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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 public: | 113 public: |
| 114 explicit FakeSafeBrowsingService(const std::string& url_prefix) | 114 explicit FakeSafeBrowsingService(const std::string& url_prefix) |
| 115 : url_prefix_(url_prefix) {} | 115 : url_prefix_(url_prefix) {} |
| 116 | 116 |
| 117 SafeBrowsingProtocolConfig GetProtocolConfig() const override { | 117 SafeBrowsingProtocolConfig GetProtocolConfig() const override { |
| 118 SafeBrowsingProtocolConfig config; | 118 SafeBrowsingProtocolConfig config; |
| 119 config.url_prefix = url_prefix_; | 119 config.url_prefix = url_prefix_; |
| 120 // Makes sure the auto update is not triggered. The tests will force the | 120 // Makes sure the auto update is not triggered. The tests will force the |
| 121 // update when needed. | 121 // update when needed. |
| 122 config.disable_auto_update = true; | 122 config.disable_auto_update = true; |
| 123 #if defined(OS_ANDROID) | |
| 124 config.disable_connection_check = true; | |
| 125 #endif | |
| 126 config.client_name = "browser_tests"; | 123 config.client_name = "browser_tests"; |
| 127 return config; | 124 return config; |
| 128 } | 125 } |
| 129 | 126 |
| 130 private: | 127 private: |
| 131 ~FakeSafeBrowsingService() override {} | 128 ~FakeSafeBrowsingService() override {} |
| 132 | 129 |
| 133 std::string url_prefix_; | 130 std::string url_prefix_; |
| 134 | 131 |
| 135 DISALLOW_COPY_AND_ASSIGN(FakeSafeBrowsingService); | 132 DISALLOW_COPY_AND_ASSIGN(FakeSafeBrowsingService); |
| (...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 574 safe_browsing_helper->FetchDBToVerify(test_server(), step)); | 571 safe_browsing_helper->FetchDBToVerify(test_server(), step)); |
| 575 EXPECT_GT(safe_browsing_helper->response_data().size(), 0U); | 572 EXPECT_GT(safe_browsing_helper->response_data().size(), 0U); |
| 576 last_step = step; | 573 last_step = step; |
| 577 } | 574 } |
| 578 | 575 |
| 579 // Verifies with server if test is done and waits till server responses. | 576 // Verifies with server if test is done and waits till server responses. |
| 580 EXPECT_EQ(net::URLRequestStatus::SUCCESS, | 577 EXPECT_EQ(net::URLRequestStatus::SUCCESS, |
| 581 safe_browsing_helper->VerifyTestComplete(test_server(), last_step)); | 578 safe_browsing_helper->VerifyTestComplete(test_server(), last_step)); |
| 582 EXPECT_EQ("yes", safe_browsing_helper->response_data()); | 579 EXPECT_EQ("yes", safe_browsing_helper->response_data()); |
| 583 } | 580 } |
| OLD | NEW |