| 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 13 matching lines...) Expand all Loading... |
| 24 #include "base/strings/string_number_conversions.h" | 24 #include "base/strings/string_number_conversions.h" |
| 25 #include "base/strings/string_split.h" | 25 #include "base/strings/string_split.h" |
| 26 #include "base/strings/stringprintf.h" | 26 #include "base/strings/stringprintf.h" |
| 27 #include "base/strings/utf_string_conversions.h" | 27 #include "base/strings/utf_string_conversions.h" |
| 28 #include "base/synchronization/lock.h" | 28 #include "base/synchronization/lock.h" |
| 29 #include "base/test/test_timeouts.h" | 29 #include "base/test/test_timeouts.h" |
| 30 #include "base/threading/platform_thread.h" | 30 #include "base/threading/platform_thread.h" |
| 31 #include "base/threading/thread.h" | 31 #include "base/threading/thread.h" |
| 32 #include "base/time/time.h" | 32 #include "base/time/time.h" |
| 33 #include "chrome/browser/browser_process.h" | 33 #include "chrome/browser/browser_process.h" |
| 34 #include "chrome/browser/chrome_notification_types.h" |
| 34 #include "chrome/browser/profiles/profile.h" | 35 #include "chrome/browser/profiles/profile.h" |
| 35 #include "chrome/browser/safe_browsing/database_manager.h" | 36 #include "chrome/browser/safe_browsing/database_manager.h" |
| 36 #include "chrome/browser/safe_browsing/local_safebrowsing_test_server.h" | 37 #include "chrome/browser/safe_browsing/local_safebrowsing_test_server.h" |
| 37 #include "chrome/browser/safe_browsing/protocol_manager.h" | 38 #include "chrome/browser/safe_browsing/protocol_manager.h" |
| 38 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | 39 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
| 39 #include "chrome/browser/ui/browser.h" | 40 #include "chrome/browser/ui/browser.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/load_flags.h" | 47 #include "net/base/load_flags.h" |
| 48 #include "net/base/net_log.h" | 48 #include "net/base/net_log.h" |
| 49 #include "net/dns/host_resolver.h" | 49 #include "net/dns/host_resolver.h" |
| 50 #include "net/test/python_utils.h" | 50 #include "net/test/python_utils.h" |
| (...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 524 safe_browsing_helper->FetchDBToVerify(test_server(), step)); | 524 safe_browsing_helper->FetchDBToVerify(test_server(), step)); |
| 525 EXPECT_GT(safe_browsing_helper->response_data().size(), 0U); | 525 EXPECT_GT(safe_browsing_helper->response_data().size(), 0U); |
| 526 last_step = step; | 526 last_step = step; |
| 527 } | 527 } |
| 528 | 528 |
| 529 // Verifies with server if test is done and waits till server responses. | 529 // Verifies with server if test is done and waits till server responses. |
| 530 EXPECT_EQ(net::URLRequestStatus::SUCCESS, | 530 EXPECT_EQ(net::URLRequestStatus::SUCCESS, |
| 531 safe_browsing_helper->VerifyTestComplete(test_server(), last_step)); | 531 safe_browsing_helper->VerifyTestComplete(test_server(), last_step)); |
| 532 EXPECT_EQ("yes", safe_browsing_helper->response_data()); | 532 EXPECT_EQ("yes", safe_browsing_helper->response_data()); |
| 533 } | 533 } |
| OLD | NEW |