| 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 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 | 273 |
| 274 InProcessBrowserTest::SetUp(); | 274 InProcessBrowserTest::SetUp(); |
| 275 } | 275 } |
| 276 | 276 |
| 277 void TearDown() override { | 277 void TearDown() override { |
| 278 InProcessBrowserTest::TearDown(); | 278 InProcessBrowserTest::TearDown(); |
| 279 | 279 |
| 280 SafeBrowsingService::RegisterFactory(NULL); | 280 SafeBrowsingService::RegisterFactory(NULL); |
| 281 } | 281 } |
| 282 | 282 |
| 283 void SetUpCommandLine(CommandLine* command_line) override { | 283 void SetUpCommandLine(base::CommandLine* command_line) override { |
| 284 // This test uses loopback. No need to use IPv6 especially it makes | 284 // This test uses loopback. No need to use IPv6 especially it makes |
| 285 // local requests slow on Windows trybot when ipv6 local address [::1] | 285 // local requests slow on Windows trybot when ipv6 local address [::1] |
| 286 // is not setup. | 286 // is not setup. |
| 287 command_line->AppendSwitch(switches::kDisableIPv6); | 287 command_line->AppendSwitch(switches::kDisableIPv6); |
| 288 | 288 |
| 289 // TODO(lzheng): The test server does not understand download related | 289 // TODO(lzheng): The test server does not understand download related |
| 290 // requests. We need to fix the server. | 290 // requests. We need to fix the server. |
| 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 |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 572 safe_browsing_helper->FetchDBToVerify(test_server(), step)); | 572 safe_browsing_helper->FetchDBToVerify(test_server(), step)); |
| 573 EXPECT_GT(safe_browsing_helper->response_data().size(), 0U); | 573 EXPECT_GT(safe_browsing_helper->response_data().size(), 0U); |
| 574 last_step = step; | 574 last_step = step; |
| 575 } | 575 } |
| 576 | 576 |
| 577 // Verifies with server if test is done and waits till server responses. | 577 // Verifies with server if test is done and waits till server responses. |
| 578 EXPECT_EQ(net::URLRequestStatus::SUCCESS, | 578 EXPECT_EQ(net::URLRequestStatus::SUCCESS, |
| 579 safe_browsing_helper->VerifyTestComplete(test_server(), last_step)); | 579 safe_browsing_helper->VerifyTestComplete(test_server(), last_step)); |
| 580 EXPECT_EQ("yes", safe_browsing_helper->response_data()); | 580 EXPECT_EQ("yes", safe_browsing_helper->response_data()); |
| 581 } | 581 } |
| OLD | NEW |