| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 542 } | 542 } |
| 543 | 543 |
| 544 base::OneShotTimer<SafeBrowsingServiceTestHelper> check_update_timer_; | 544 base::OneShotTimer<SafeBrowsingServiceTestHelper> check_update_timer_; |
| 545 SafeBrowsingServiceTest* safe_browsing_test_; | 545 SafeBrowsingServiceTest* safe_browsing_test_; |
| 546 scoped_ptr<content::URLFetcher> url_fetcher_; | 546 scoped_ptr<content::URLFetcher> url_fetcher_; |
| 547 std::string response_data_; | 547 std::string response_data_; |
| 548 net::URLRequestStatus::Status response_status_; | 548 net::URLRequestStatus::Status response_status_; |
| 549 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingServiceTestHelper); | 549 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingServiceTestHelper); |
| 550 }; | 550 }; |
| 551 | 551 |
| 552 #if defined(OS_WIN) && defined(NDEBUG) | 552 // See http://crbug.com/96459 |
| 553 #define MAYBE_SafeBrowsingSystemTest FLAKY_SafeBrowsingSystemTest | 553 IN_PROC_BROWSER_TEST_F(SafeBrowsingServiceTest, FLAKY_SafeBrowsingSystemTest) { |
| 554 #else | |
| 555 #define MAYBE_SafeBrowsingSystemTest SafeBrowsingServiceTest | |
| 556 #endif | |
| 557 // See http://crbug.com/96489 | |
| 558 IN_PROC_BROWSER_TEST_F(SafeBrowsingServiceTest, MAYBE_SafeBrowsingSystemTest) { | |
| 559 LOG(INFO) << "Start test"; | 554 LOG(INFO) << "Start test"; |
| 560 const char* server_host = SafeBrowsingTestServer::Host(); | 555 const char* server_host = SafeBrowsingTestServer::Host(); |
| 561 int server_port = SafeBrowsingTestServer::Port(); | 556 int server_port = SafeBrowsingTestServer::Port(); |
| 562 ASSERT_TRUE(InitSafeBrowsingService()); | 557 ASSERT_TRUE(InitSafeBrowsingService()); |
| 563 | 558 |
| 564 scoped_refptr<SafeBrowsingServiceTestHelper> safe_browsing_helper( | 559 scoped_refptr<SafeBrowsingServiceTestHelper> safe_browsing_helper( |
| 565 new SafeBrowsingServiceTestHelper(this)); | 560 new SafeBrowsingServiceTestHelper(this)); |
| 566 int last_step = 0; | 561 int last_step = 0; |
| 567 FilePath datafile_path = FilePath(kDataFile); | 562 FilePath datafile_path = FilePath(kDataFile); |
| 568 SafeBrowsingTestServer test_server(datafile_path); | 563 SafeBrowsingTestServer test_server(datafile_path); |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 651 } | 646 } |
| 652 | 647 |
| 653 // Verifies with server if test is done and waits till server responses. | 648 // Verifies with server if test is done and waits till server responses. |
| 654 EXPECT_EQ(net::URLRequestStatus::SUCCESS, | 649 EXPECT_EQ(net::URLRequestStatus::SUCCESS, |
| 655 safe_browsing_helper->VerifyTestComplete(server_host, | 650 safe_browsing_helper->VerifyTestComplete(server_host, |
| 656 server_port, | 651 server_port, |
| 657 last_step)); | 652 last_step)); |
| 658 EXPECT_EQ("yes", safe_browsing_helper->response_data()); | 653 EXPECT_EQ("yes", safe_browsing_helper->response_data()); |
| 659 test_server.Stop(); | 654 test_server.Stop(); |
| 660 } | 655 } |
| OLD | NEW |