| 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 26 matching lines...) Expand all Loading... |
| 37 #include "chrome/browser/safe_browsing/protocol_manager.h" | 37 #include "chrome/browser/safe_browsing/protocol_manager.h" |
| 38 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | 38 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
| 39 #include "chrome/browser/ui/browser.h" | 39 #include "chrome/browser/ui/browser.h" |
| 40 #include "chrome/common/chrome_notification_types.h" | 40 #include "chrome/common/chrome_notification_types.h" |
| 41 #include "chrome/common/chrome_switches.h" | 41 #include "chrome/common/chrome_switches.h" |
| 42 #include "chrome/common/url_constants.h" | 42 #include "chrome/common/url_constants.h" |
| 43 #include "chrome/test/base/in_process_browser_test.h" | 43 #include "chrome/test/base/in_process_browser_test.h" |
| 44 #include "chrome/test/base/ui_test_utils.h" | 44 #include "chrome/test/base/ui_test_utils.h" |
| 45 #include "content/public/browser/browser_context.h" | 45 #include "content/public/browser/browser_context.h" |
| 46 #include "content/public/test/test_browser_thread.h" | 46 #include "content/public/test/test_browser_thread.h" |
| 47 #include "net/base/host_resolver.h" | |
| 48 #include "net/base/load_flags.h" | 47 #include "net/base/load_flags.h" |
| 49 #include "net/base/net_log.h" | 48 #include "net/base/net_log.h" |
| 49 #include "net/dns/host_resolver.h" |
| 50 #include "net/test/python_utils.h" | 50 #include "net/test/python_utils.h" |
| 51 #include "net/url_request/url_fetcher.h" | 51 #include "net/url_request/url_fetcher.h" |
| 52 #include "net/url_request/url_fetcher_delegate.h" | 52 #include "net/url_request/url_fetcher_delegate.h" |
| 53 #include "net/url_request/url_request_status.h" | 53 #include "net/url_request/url_request_status.h" |
| 54 #include "testing/gtest/include/gtest/gtest.h" | 54 #include "testing/gtest/include/gtest/gtest.h" |
| 55 | 55 |
| 56 using content::BrowserThread; | 56 using content::BrowserThread; |
| 57 | 57 |
| 58 namespace { | 58 namespace { |
| 59 | 59 |
| (...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 520 safe_browsing_helper->FetchDBToVerify(test_server(), step)); | 520 safe_browsing_helper->FetchDBToVerify(test_server(), step)); |
| 521 EXPECT_GT(safe_browsing_helper->response_data().size(), 0U); | 521 EXPECT_GT(safe_browsing_helper->response_data().size(), 0U); |
| 522 last_step = step; | 522 last_step = step; |
| 523 } | 523 } |
| 524 | 524 |
| 525 // Verifies with server if test is done and waits till server responses. | 525 // Verifies with server if test is done and waits till server responses. |
| 526 EXPECT_EQ(net::URLRequestStatus::SUCCESS, | 526 EXPECT_EQ(net::URLRequestStatus::SUCCESS, |
| 527 safe_browsing_helper->VerifyTestComplete(test_server(), last_step)); | 527 safe_browsing_helper->VerifyTestComplete(test_server(), last_step)); |
| 528 EXPECT_EQ("yes", safe_browsing_helper->response_data()); | 528 EXPECT_EQ("yes", safe_browsing_helper->response_data()); |
| 529 } | 529 } |
| OLD | NEW |