Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(118)

Unified Diff: recovery/recovery_test.cc

Issue 624713003: Keep only base/extractor.[cc|h]. (Closed) Base URL: https://chromium.googlesource.com/external/omaha.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « recovery/recovery_markup.rc ('k') | recovery/repair_exe/build.scons » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: recovery/recovery_test.cc
diff --git a/recovery/recovery_test.cc b/recovery/recovery_test.cc
deleted file mode 100644
index a99d33cf8e2e3b4f90f6e9806028b82fbbcf680b..0000000000000000000000000000000000000000
--- a/recovery/recovery_test.cc
+++ /dev/null
@@ -1,97 +0,0 @@
-// Copyright 2007-2010 Google Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-// ========================================================================
-//
-// Test app for the Google Update recovery mechanism.
-#include <windows.h>
-#include <atlstr.h>
-#include "omaha/base/const_addresses.h"
-#include "omaha/base/constants.h"
-#include "omaha/base/debug.h"
-#include "omaha/base/logging.h"
-#include "omaha/net/network_config.h"
-#include "omaha/net/network_request.h"
-#include "omaha/recovery/client/google_update_recovery.h"
-
-using omaha::UpdateDevProxyDetector;
-using omaha::FirefoxProxyDetector;
-using omaha::IEProxyDetector;
-using omaha::NetworkRequest;
-using omaha::NetworkConfig;
-using omaha::NetworkConfigManager;
-
-namespace {
-
-// Implements the DownloadFileMethod signature.
-HRESULT DownloadFile(const TCHAR* url, const TCHAR* file_path, void*) {
- UTIL_LOG(L2, (_T("[DownloadFile][%s][%s]"), url, file_path));
-
- ASSERT1(url);
- ASSERT1(file_path);
-
- CString test_url(url);
- CString test_file_path(file_path);
-
-// Include this code to override the address portion of the URL.
-#if 1
- // Change the URL below to point to a test repair exe of your own.
- const TCHAR* const kTestAddress =
- _T("http://dl.google.com/insert_your_file_here?");
-
- VERIFY1(1 == test_url.Replace(omaha::kUrlCodeRedCheck, kTestAddress));
-#endif
-
- // Initialize the network for user with no impersonation required.
- NetworkConfigManager::set_is_machine(false);
- NetworkConfig* network_config = NULL;
- HRESULT hr = S_OK;
- hr = NetworkConfigManager::Instance().GetUserNetworkConfig(&network_config);
- if (FAILED(hr)) {
- UTIL_LOG(LE, (_T("[GetUserNetworkConfig failed][0x%08x]"), hr));
- return hr;
- }
- network_config->Clear();
- network_config->Add(new UpdateDevProxyDetector);
- network_config->Add(new FirefoxProxyDetector);
- network_config->Add(new IEProxyDetector);
-
- NetworkRequest network_request(network_config->session());
- hr = network_request.DownloadFile(test_url, CString(file_path));
-
- hr = network_request.DownloadFile(test_url, CString(file_path));
- if (FAILED(hr)) {
- UTIL_LOG(LE, (_T("[DownloadFile failed][%s][0x%08x]"), test_url, hr));
- return hr;
- }
-
- int status_code = network_request.http_status_code();
- UTIL_LOG(L2, (_T("[HTTP status][%u]"), status_code));
-
- return (HTTP_STATUS_OK == status_code) ? S_OK : E_FAIL;
-}
-
-} // namespace
-
-int main() {
- const TCHAR* const kDummyGuid = _T("{20F8FA32-8E16-4046-834B-88661E021AFC}");
-
- HRESULT hr = FixGoogleUpdate(kDummyGuid,
- _T("1.0.555.0"),
- _T("en-us"),
- true,
- DownloadFile,
- NULL);
-
- return hr;
-}
« no previous file with comments | « recovery/recovery_markup.rc ('k') | recovery/repair_exe/build.scons » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698