OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
519 URLRequestStatus::Status response_status_; | 519 URLRequestStatus::Status response_status_; |
520 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingServiceTestHelper); | 520 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingServiceTestHelper); |
521 }; | 521 }; |
522 | 522 |
523 IN_PROC_BROWSER_TEST_F(SafeBrowsingServiceTest, SafeBrowsingSystemTest) { | 523 IN_PROC_BROWSER_TEST_F(SafeBrowsingServiceTest, SafeBrowsingSystemTest) { |
524 LOG(INFO) << "Start test"; | 524 LOG(INFO) << "Start test"; |
525 const char* server_host = SafeBrowsingTestServer::Host(); | 525 const char* server_host = SafeBrowsingTestServer::Host(); |
526 int server_port = SafeBrowsingTestServer::Port(); | 526 int server_port = SafeBrowsingTestServer::Port(); |
527 ASSERT_TRUE(InitSafeBrowsingService()); | 527 ASSERT_TRUE(InitSafeBrowsingService()); |
528 | 528 |
529 scoped_refptr<SafeBrowsingServiceTestHelper> safe_browsing_helper = | 529 scoped_refptr<SafeBrowsingServiceTestHelper> safe_browsing_helper( |
530 new SafeBrowsingServiceTestHelper(this); | 530 new SafeBrowsingServiceTestHelper(this)); |
531 int last_step = 0; | 531 int last_step = 0; |
532 FilePath datafile_path = FilePath(kDataFile); | 532 FilePath datafile_path = FilePath(kDataFile); |
533 SafeBrowsingTestServer test_server(datafile_path); | 533 SafeBrowsingTestServer test_server(datafile_path); |
534 ASSERT_TRUE(test_server.Start()); | 534 ASSERT_TRUE(test_server.Start()); |
535 | 535 |
536 // Make sure the server is running. | 536 // Make sure the server is running. |
537 safe_browsing_helper->WaitTillServerReady(server_host, server_port); | 537 safe_browsing_helper->WaitTillServerReady(server_host, server_port); |
538 | 538 |
539 // Waits and makes sure safebrowsing update is not happening. | 539 // Waits and makes sure safebrowsing update is not happening. |
540 // The wait will stop once OnWaitForStatusUpdateDone in | 540 // The wait will stop once OnWaitForStatusUpdateDone in |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
629 | 629 |
630 // Verifies with server if test is done and waits till server responses. | 630 // Verifies with server if test is done and waits till server responses. |
631 // EXPECT_EQ(URLRequestStatus::SUCCESS, | 631 // EXPECT_EQ(URLRequestStatus::SUCCESS, |
632 // safe_browsing_helper->VerifyTestComplete(server_host, | 632 // safe_browsing_helper->VerifyTestComplete(server_host, |
633 // server_port, | 633 // server_port, |
634 // last_step)); | 634 // last_step)); |
635 // EXPECT_EQ("yes", safe_browsing_helper->response_data()); | 635 // EXPECT_EQ("yes", safe_browsing_helper->response_data()); |
636 test_server.Stop(); | 636 test_server.Stop(); |
637 } | 637 } |
638 | 638 |
OLD | NEW |