| 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 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 command_line->AppendSwitch(switches::kSbDisableDownloadProtection); | 291 command_line->AppendSwitch(switches::kSbDisableDownloadProtection); |
| 292 | 292 |
| 293 // TODO(gcasto): Generate new testing data that includes the | 293 // TODO(gcasto): Generate new testing data that includes the |
| 294 // client-side phishing whitelist. | 294 // client-side phishing whitelist. |
| 295 command_line->AppendSwitch( | 295 command_line->AppendSwitch( |
| 296 switches::kDisableClientSidePhishingDetection); | 296 switches::kDisableClientSidePhishingDetection); |
| 297 | 297 |
| 298 // TODO(kalman): Generate new testing data that includes the extension | 298 // TODO(kalman): Generate new testing data that includes the extension |
| 299 // blacklist. | 299 // blacklist. |
| 300 command_line->AppendSwitch(switches::kSbDisableExtensionBlacklist); | 300 command_line->AppendSwitch(switches::kSbDisableExtensionBlacklist); |
| 301 | |
| 302 // TODO(tburkard): Generate new testing data that includes the side-effect | |
| 303 // free whitelist. | |
| 304 command_line->AppendSwitch(switches::kSbDisableSideEffectFreeWhitelist); | |
| 305 } | 301 } |
| 306 | 302 |
| 307 void SetTestStep(int step) { | 303 void SetTestStep(int step) { |
| 308 std::string test_step = base::StringPrintf("test_step=%d", step); | 304 std::string test_step = base::StringPrintf("test_step=%d", step); |
| 309 safe_browsing_service_->protocol_manager_->set_additional_query(test_step); | 305 safe_browsing_service_->protocol_manager_->set_additional_query(test_step); |
| 310 } | 306 } |
| 311 | 307 |
| 312 private: | 308 private: |
| 313 scoped_ptr<TestSafeBrowsingServiceFactory> sb_factory_; | 309 scoped_ptr<TestSafeBrowsingServiceFactory> sb_factory_; |
| 314 | 310 |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 573 safe_browsing_helper->FetchDBToVerify(test_server(), step)); | 569 safe_browsing_helper->FetchDBToVerify(test_server(), step)); |
| 574 EXPECT_GT(safe_browsing_helper->response_data().size(), 0U); | 570 EXPECT_GT(safe_browsing_helper->response_data().size(), 0U); |
| 575 last_step = step; | 571 last_step = step; |
| 576 } | 572 } |
| 577 | 573 |
| 578 // Verifies with server if test is done and waits till server responses. | 574 // Verifies with server if test is done and waits till server responses. |
| 579 EXPECT_EQ(net::URLRequestStatus::SUCCESS, | 575 EXPECT_EQ(net::URLRequestStatus::SUCCESS, |
| 580 safe_browsing_helper->VerifyTestComplete(test_server(), last_step)); | 576 safe_browsing_helper->VerifyTestComplete(test_server(), last_step)); |
| 581 EXPECT_EQ("yes", safe_browsing_helper->response_data()); | 577 EXPECT_EQ("yes", safe_browsing_helper->response_data()); |
| 582 } | 578 } |
| OLD | NEW |