OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_FRAME_TEST_UTILS_H_ |
| 6 #define CHROME_FRAME_TEST_UTILS_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 // Helper class used to register different chrome frame DLLs while running |
| 11 // tests. At construction, this registers the DLL found in the build path. |
| 12 // At destruction, again registers the DLL found in the build path if another |
| 13 // DLL has since been registered. Triggers GTEST asserts on failure. |
| 14 // |
| 15 // TODO(robertshield): Ideally, make this class restore the originally |
| 16 // registered chrome frame DLL (e.g. by looking in HKCR) on destruction. |
| 17 class ScopedChromeFrameRegistrar { |
| 18 public: |
| 19 ScopedChromeFrameRegistrar(); |
| 20 virtual ~ScopedChromeFrameRegistrar(); |
| 21 |
| 22 void RegisterChromeFrameAtPath(const std::wstring& path); |
| 23 void RegisterReferenceChromeFrameBuild(); |
| 24 |
| 25 std::wstring GetChromeFrameDllPath() const; |
| 26 |
| 27 static std::wstring GetChromeFrameBuildPath(); |
| 28 static void RegisterAtPath(const std::wstring& path); |
| 29 static void RegisterDefaults(); |
| 30 |
| 31 private: |
| 32 // Contains the path of the most recently registered npchrome_tab.dll. |
| 33 std::wstring new_chrome_frame_dll_path_; |
| 34 |
| 35 // Contains the path of the npchrome_tab.dll to be registered at destruction. |
| 36 std::wstring original_dll_path_; |
| 37 }; |
| 38 |
| 39 #endif // CHROME_FRAME_TEST_UTILS_H_ |
OLD | NEW |