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 // A test that exercises Chrome Frame's DLL Redirctor update code. This test | 5 // A test that exercises Chrome Frame's DLL Redirctor update code. This test |
6 // generates a new version of CF from the one already in the build folder and | 6 // generates a new version of CF from the one already in the build folder and |
7 // then loads them both into the current process to verify the handoff. | 7 // then loads them both into the current process to verify the handoff. |
8 | 8 |
9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
11 #include "base/file_version_info.h" | 11 #include "base/file_version_info.h" |
| 12 #include "base/files/scoped_temp_dir.h" |
12 #include "base/path_service.h" | 13 #include "base/path_service.h" |
13 #include "base/scoped_native_library.h" | 14 #include "base/scoped_native_library.h" |
14 #include "base/scoped_temp_dir.h" | |
15 #include "base/shared_memory.h" | 15 #include "base/shared_memory.h" |
16 #include "base/string_util.h" | 16 #include "base/string_util.h" |
17 #include "base/version.h" | 17 #include "base/version.h" |
18 #include "base/win/scoped_comptr.h" | 18 #include "base/win/scoped_comptr.h" |
19 #include "chrome/installer/test/alternate_version_generator.h" | 19 #include "chrome/installer/test/alternate_version_generator.h" |
20 #include "chrome/installer/util/delete_after_reboot_helper.h" | 20 #include "chrome/installer/util/delete_after_reboot_helper.h" |
21 #include "chrome_frame/chrome_tab.h" | 21 #include "chrome_frame/chrome_tab.h" |
22 #include "chrome_frame/test_utils.h" | 22 #include "chrome_frame/test_utils.h" |
23 #include "chrome_frame/utils.h" | 23 #include "chrome_frame/utils.h" |
24 #include "testing/gtest/include/gtest/gtest.h" | 24 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 ScheduleDirectoryForDeletion(temp_dir_.path().value().c_str()); | 106 ScheduleDirectoryForDeletion(temp_dir_.path().value().c_str()); |
107 } | 107 } |
108 } | 108 } |
109 | 109 |
110 protected: | 110 protected: |
111 static FilePath original_chrome_frame_dll_; | 111 static FilePath original_chrome_frame_dll_; |
112 static FilePath new_chrome_frame_dll_; | 112 static FilePath new_chrome_frame_dll_; |
113 static scoped_ptr<Version> original_version_; | 113 static scoped_ptr<Version> original_version_; |
114 static scoped_ptr<Version> new_version_; | 114 static scoped_ptr<Version> new_version_; |
115 | 115 |
116 static ScopedTempDir temp_dir_; | 116 static base::ScopedTempDir temp_dir_; |
117 }; // class DllRedirectorLoadingTest | 117 }; // class DllRedirectorLoadingTest |
118 | 118 |
119 FilePath DllRedirectorLoadingTest::original_chrome_frame_dll_; | 119 FilePath DllRedirectorLoadingTest::original_chrome_frame_dll_; |
120 FilePath DllRedirectorLoadingTest::new_chrome_frame_dll_; | 120 FilePath DllRedirectorLoadingTest::new_chrome_frame_dll_; |
121 scoped_ptr<Version> DllRedirectorLoadingTest::original_version_; | 121 scoped_ptr<Version> DllRedirectorLoadingTest::original_version_; |
122 scoped_ptr<Version> DllRedirectorLoadingTest::new_version_; | 122 scoped_ptr<Version> DllRedirectorLoadingTest::new_version_; |
123 ScopedTempDir DllRedirectorLoadingTest::temp_dir_; | 123 base::ScopedTempDir DllRedirectorLoadingTest::temp_dir_; |
124 | 124 |
125 #if defined(COMPONENT_BUILD) | 125 #if defined(COMPONENT_BUILD) |
126 // Disabling since npchrome_frame.dll's DllMain can't handle being loaded into | 126 // Disabling since npchrome_frame.dll's DllMain can't handle being loaded into |
127 // a process that has already started services in base.dll such as logging; see | 127 // a process that has already started services in base.dll such as logging; see |
128 // http://crbug.com/110492. | 128 // http://crbug.com/110492. |
129 #define MAYBE_TestDllRedirection DISABLED_TestDllRedirection | 129 #define MAYBE_TestDllRedirection DISABLED_TestDllRedirection |
130 #else | 130 #else |
131 #define MAYBE_TestDllRedirection TestDllRedirection | 131 #define MAYBE_TestDllRedirection TestDllRedirection |
132 #endif | 132 #endif |
133 | 133 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 | 208 |
209 char buffer[kSharedMemoryBytes] = {0}; | 209 char buffer[kSharedMemoryBytes] = {0}; |
210 memcpy(buffer, beacon.memory(), kSharedMemoryBytes - 1); | 210 memcpy(buffer, beacon.memory(), kSharedMemoryBytes - 1); |
211 Version beacon_version(buffer); | 211 Version beacon_version(buffer); |
212 ASSERT_TRUE(beacon_version.IsValid()); | 212 ASSERT_TRUE(beacon_version.IsValid()); |
213 | 213 |
214 EXPECT_EQ(0, | 214 EXPECT_EQ(0, |
215 beacon_version.CompareTo(*test_data[i].expected_beacon_version)); | 215 beacon_version.CompareTo(*test_data[i].expected_beacon_version)); |
216 } | 216 } |
217 } | 217 } |
OLD | NEW |