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 | 5 |
6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
7 #include "base/memory/scoped_vector.h" | 7 #include "base/memory/scoped_vector.h" |
8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
9 #include "base/test/test_simple_task_runner.h" | 9 #include "base/test/test_simple_task_runner.h" |
10 #include "base/thread_task_runner_handle.h" | 10 #include "base/thread_task_runner_handle.h" |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 | 75 |
76 scoped_ptr<SafeBrowsingProtocolManager> CreateProtocolManager( | 76 scoped_ptr<SafeBrowsingProtocolManager> CreateProtocolManager( |
77 SafeBrowsingProtocolManagerDelegate* delegate) { | 77 SafeBrowsingProtocolManagerDelegate* delegate) { |
78 SafeBrowsingProtocolConfig config; | 78 SafeBrowsingProtocolConfig config; |
79 config.client_name = kClient; | 79 config.client_name = kClient; |
80 config.url_prefix = kUrlPrefix; | 80 config.url_prefix = kUrlPrefix; |
81 config.backup_connect_error_url_prefix = kBackupConnectUrlPrefix; | 81 config.backup_connect_error_url_prefix = kBackupConnectUrlPrefix; |
82 config.backup_http_error_url_prefix = kBackupHttpUrlPrefix; | 82 config.backup_http_error_url_prefix = kBackupHttpUrlPrefix; |
83 config.backup_network_error_url_prefix = kBackupNetworkUrlPrefix; | 83 config.backup_network_error_url_prefix = kBackupNetworkUrlPrefix; |
84 config.version = kAppVer; | 84 config.version = kAppVer; |
85 | 85 #if defined(OS_ANDROID) |
| 86 config.disable_connection_check = true; |
| 87 #endif |
86 return scoped_ptr<SafeBrowsingProtocolManager>( | 88 return scoped_ptr<SafeBrowsingProtocolManager>( |
87 SafeBrowsingProtocolManager::Create(delegate, NULL, config)); | 89 SafeBrowsingProtocolManager::Create(delegate, NULL, config)); |
88 } | 90 } |
89 | 91 |
90 void ValidateUpdateFetcherRequest( | 92 void ValidateUpdateFetcherRequest( |
91 const net::TestURLFetcher* url_fetcher, | 93 const net::TestURLFetcher* url_fetcher, |
92 const std::string& expected_prefix) { | 94 const std::string& expected_prefix) { |
93 ASSERT_TRUE(url_fetcher); | 95 ASSERT_TRUE(url_fetcher); |
94 EXPECT_EQ(net::LOAD_DISABLE_CACHE, url_fetcher->GetLoadFlags()); | 96 EXPECT_EQ(net::LOAD_DISABLE_CACHE, url_fetcher->GetLoadFlags()); |
95 EXPECT_EQ("goog-phish-shavar;\ngoog-malware-shavar;\n", | 97 EXPECT_EQ("goog-phish-shavar;\ngoog-malware-shavar;\n", |
(...skipping 1008 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1104 second_chunk_url_fetcher->delegate()->OnURLFetchComplete( | 1106 second_chunk_url_fetcher->delegate()->OnURLFetchComplete( |
1105 second_chunk_url_fetcher); | 1107 second_chunk_url_fetcher); |
1106 | 1108 |
1107 EXPECT_FALSE(pm->IsUpdateScheduled()); | 1109 EXPECT_FALSE(pm->IsUpdateScheduled()); |
1108 | 1110 |
1109 // Invoke the AddChunksCallback to finish the update. | 1111 // Invoke the AddChunksCallback to finish the update. |
1110 runner->RunPendingTasks(); | 1112 runner->RunPendingTasks(); |
1111 | 1113 |
1112 EXPECT_TRUE(pm->IsUpdateScheduled()); | 1114 EXPECT_TRUE(pm->IsUpdateScheduled()); |
1113 } | 1115 } |
OLD | NEW |