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

Unified Diff: chrome/installer/test/resource_loader.h

Issue 5236002: Add infrastructure enabling tests of installer upgrade scenarios.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 1 month 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
Index: chrome/installer/test/resource_loader.h
===================================================================
--- chrome/installer/test/resource_loader.h (revision 0)
+++ chrome/installer/test/resource_loader.h (revision 0)
@@ -0,0 +1,49 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// A helper class for loading resources out of portable executable files.
+
+#ifndef CHROME_INSTALLER_TEST_RESOURCE_LOADER_H_
+#define CHROME_INSTALLER_TEST_RESOURCE_LOADER_H_
+#pragma once
+
+#include <windows.h>
+
+#include <string>
+#include <utility>
+
+#include "base/basictypes.h"
+
+class FilePath;
+
+namespace upgrade_test {
+
+// Loads resources in a PE image file.
+class ResourceLoader {
+ public:
+ ResourceLoader();
+ ~ResourceLoader();
+
+ // Loads |pe_image_path| in preparation for loading its resources.
+ bool Initialize(const FilePath& pe_image_path);
+
+ // Places the address and size of the resource |name| of |type| into
+ // |resource_data|, returning true on success. The address of the resource is
+ // valid only until this instance is destroyed.
+ bool Load(const std::wstring& name, const std::wstring& type,
+ std::pair<const uint8*, DWORD>* resource_data);
+
+ // Places the address and size of the resource |id| of |type| into
+ // |resource_data|, returning true on success. The address of the resource is
+ // valid only until this instance is destroyed.
+ bool Load(WORD id, WORD type, std::pair<const uint8*, DWORD>* resource_data);
+
+ private:
+ HMODULE module_;
+ DISALLOW_COPY_AND_ASSIGN(ResourceLoader);
+}; // class ResourceLoader
+
+} // namespace upgrade_test
+
+#endif // CHROME_INSTALLER_TEST_RESOURCE_LOADER_H_
Property changes on: chrome\installer\test\resource_loader.h
___________________________________________________________________
Added: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698