| 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 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 InProcessBrowserTest::SetUp(); | 288 InProcessBrowserTest::SetUp(); |
| 289 } | 289 } |
| 290 | 290 |
| 291 void TearDown() override { | 291 void TearDown() override { |
| 292 InProcessBrowserTest::TearDown(); | 292 InProcessBrowserTest::TearDown(); |
| 293 | 293 |
| 294 SafeBrowsingService::RegisterFactory(NULL); | 294 SafeBrowsingService::RegisterFactory(NULL); |
| 295 } | 295 } |
| 296 | 296 |
| 297 void SetUpCommandLine(base::CommandLine* command_line) override { | 297 void SetUpCommandLine(base::CommandLine* command_line) override { |
| 298 // This test uses loopback. No need to use IPv6 especially it makes | |
| 299 // local requests slow on Windows trybot when ipv6 local address [::1] | |
| 300 // is not setup. | |
| 301 command_line->AppendSwitch(switches::kDisableIPv6); | |
| 302 | |
| 303 // TODO(lzheng): The test server does not understand download related | 298 // TODO(lzheng): The test server does not understand download related |
| 304 // requests. We need to fix the server. | 299 // requests. We need to fix the server. |
| 305 command_line->AppendSwitch(switches::kSbDisableDownloadProtection); | 300 command_line->AppendSwitch(switches::kSbDisableDownloadProtection); |
| 306 | 301 |
| 307 // TODO(gcasto): Generate new testing data that includes the | 302 // TODO(gcasto): Generate new testing data that includes the |
| 308 // client-side phishing whitelist. | 303 // client-side phishing whitelist. |
| 309 command_line->AppendSwitch( | 304 command_line->AppendSwitch( |
| 310 switches::kDisableClientSidePhishingDetection); | 305 switches::kDisableClientSidePhishingDetection); |
| 311 | 306 |
| 312 // TODO(kalman): Generate new testing data that includes the extension | 307 // TODO(kalman): Generate new testing data that includes the extension |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 582 safe_browsing_helper->FetchDBToVerify(test_server(), step)); | 577 safe_browsing_helper->FetchDBToVerify(test_server(), step)); |
| 583 EXPECT_GT(safe_browsing_helper->response_data().size(), 0U); | 578 EXPECT_GT(safe_browsing_helper->response_data().size(), 0U); |
| 584 last_step = step; | 579 last_step = step; |
| 585 } | 580 } |
| 586 | 581 |
| 587 // Verifies with server if test is done and waits till server responses. | 582 // Verifies with server if test is done and waits till server responses. |
| 588 EXPECT_EQ(net::URLRequestStatus::SUCCESS, | 583 EXPECT_EQ(net::URLRequestStatus::SUCCESS, |
| 589 safe_browsing_helper->VerifyTestComplete(test_server(), last_step)); | 584 safe_browsing_helper->VerifyTestComplete(test_server(), last_step)); |
| 590 EXPECT_EQ("yes", safe_browsing_helper->response_data()); | 585 EXPECT_EQ("yes", safe_browsing_helper->response_data()); |
| 591 } | 586 } |
| OLD | NEW |