| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 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 | 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 #include <windows.h> | 5 #include <windows.h> |
| 6 #include <shellapi.h> | 6 #include <shellapi.h> |
| 7 #include <shlobj.h> | 7 #include <shlobj.h> |
| 8 | 8 |
| 9 #include <fstream> | 9 #include <fstream> |
| 10 #include <iostream> | 10 #include <iostream> |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 test_dir_ = test_dir_.AppendASCII("ShellUtilTest"); | 91 test_dir_ = test_dir_.AppendASCII("ShellUtilTest"); |
| 92 | 92 |
| 93 // Create a fresh, empty copy of this test directory. | 93 // Create a fresh, empty copy of this test directory. |
| 94 file_util::Delete(test_dir_, true); | 94 file_util::Delete(test_dir_, true); |
| 95 file_util::CreateDirectoryW(test_dir_); | 95 file_util::CreateDirectoryW(test_dir_); |
| 96 ASSERT_TRUE(file_util::PathExists(test_dir_)); | 96 ASSERT_TRUE(file_util::PathExists(test_dir_)); |
| 97 } | 97 } |
| 98 | 98 |
| 99 virtual void TearDown() { | 99 virtual void TearDown() { |
| 100 // Clean up test directory | 100 // Clean up test directory |
| 101 ASSERT_TRUE(file_util::Delete(test_dir_, false)); | 101 ASSERT_TRUE(file_util::Delete(test_dir_, true)); |
| 102 ASSERT_FALSE(file_util::PathExists(test_dir_)); | 102 ASSERT_FALSE(file_util::PathExists(test_dir_)); |
| 103 } | 103 } |
| 104 | 104 |
| 105 // The path to temporary directory used to contain the test operations. | 105 // The path to temporary directory used to contain the test operations. |
| 106 FilePath test_dir_; | 106 FilePath test_dir_; |
| 107 }; | 107 }; |
| 108 }; | 108 }; |
| 109 | 109 |
| 110 // Test that we can open archives successfully. | 110 // Test that we can open archives successfully. |
| 111 TEST_F(ShellUtilTest, UpdateChromeShortcutTest) { | 111 TEST_F(ShellUtilTest, UpdateChromeShortcutTest) { |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 // Now change only description to update shortcut and make sure icon index | 150 // Now change only description to update shortcut and make sure icon index |
| 151 // doesn't change. | 151 // doesn't change. |
| 152 const std::wstring description2(L"dummy description 2"); | 152 const std::wstring description2(L"dummy description 2"); |
| 153 EXPECT_TRUE(ShellUtil::UpdateChromeShortcut(exe_path.value(), | 153 EXPECT_TRUE(ShellUtil::UpdateChromeShortcut(exe_path.value(), |
| 154 shortcut_path.value(), | 154 shortcut_path.value(), |
| 155 description2, false)); | 155 description2, false)); |
| 156 EXPECT_TRUE(VerifyChromeShortcut(exe_path.value(), | 156 EXPECT_TRUE(VerifyChromeShortcut(exe_path.value(), |
| 157 shortcut_path.value(), | 157 shortcut_path.value(), |
| 158 description2, 1)); | 158 description2, 1)); |
| 159 } | 159 } |
| OLD | NEW |