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

Side by Side Diff: chrome/installer/util/shell_util_unittest.cc

Issue 6825055: Include base/win/scoped_comptr.h instead of base/scoped_comptr_win.h. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: revert bad indentation, rebase Created 9 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/common/win_safe_util.cc ('k') | chrome/service/cloud_print/print_system_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 10
11 #include "base/file_util.h" 11 #include "base/file_util.h"
12 #include "base/path_service.h" 12 #include "base/path_service.h"
13 #include "base/scoped_comptr_win.h"
14 #include "base/memory/scoped_temp_dir.h" 13 #include "base/memory/scoped_temp_dir.h"
14 #include "base/win/scoped_comptr.h"
15 #include "chrome/installer/util/browser_distribution.h" 15 #include "chrome/installer/util/browser_distribution.h"
16 #include "chrome/installer/util/master_preferences.h" 16 #include "chrome/installer/util/master_preferences.h"
17 #include "chrome/installer/util/shell_util.h" 17 #include "chrome/installer/util/shell_util.h"
18 #include "testing/gtest/include/gtest/gtest.h" 18 #include "testing/gtest/include/gtest/gtest.h"
19 19
20 namespace { 20 namespace {
21 bool VerifyChromeShortcut(const std::wstring& exe_path, 21 bool VerifyChromeShortcut(const std::wstring& exe_path,
22 const std::wstring& shortcut, 22 const std::wstring& shortcut,
23 const std::wstring& description, 23 const std::wstring& description,
24 int icon_index) { 24 int icon_index) {
25 ScopedComPtr<IShellLink> i_shell_link; 25 base::win::ScopedComPtr<IShellLink> i_shell_link;
26 ScopedComPtr<IPersistFile> i_persist_file; 26 base::win::ScopedComPtr<IPersistFile> i_persist_file;
27 27
28 // Get pointer to the IShellLink interface 28 // Get pointer to the IShellLink interface
29 bool failed = FAILED(i_shell_link.CreateInstance(CLSID_ShellLink, NULL, 29 bool failed = FAILED(i_shell_link.CreateInstance(CLSID_ShellLink, NULL,
30 CLSCTX_INPROC_SERVER)); 30 CLSCTX_INPROC_SERVER));
31 EXPECT_FALSE(failed) << "Failed to get IShellLink"; 31 EXPECT_FALSE(failed) << "Failed to get IShellLink";
32 if (failed) 32 if (failed)
33 return false; 33 return false;
34 34
35 // Query IShellLink for the IPersistFile interface 35 // Query IShellLink for the IPersistFile interface
36 failed = FAILED(i_persist_file.QueryFrom(i_shell_link)); 36 failed = FAILED(i_persist_file.QueryFrom(i_shell_link));
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 // Now change only description to update shortcut and make sure icon index 139 // Now change only description to update shortcut and make sure icon index
140 // doesn't change. 140 // doesn't change.
141 const std::wstring description2(L"dummy description 2"); 141 const std::wstring description2(L"dummy description 2");
142 EXPECT_TRUE(ShellUtil::UpdateChromeShortcut(dist, exe_path.value(), 142 EXPECT_TRUE(ShellUtil::UpdateChromeShortcut(dist, exe_path.value(),
143 shortcut_path.value(), 143 shortcut_path.value(),
144 description2, false)); 144 description2, false));
145 EXPECT_TRUE(VerifyChromeShortcut(exe_path.value(), 145 EXPECT_TRUE(VerifyChromeShortcut(exe_path.value(),
146 shortcut_path.value(), 146 shortcut_path.value(),
147 description2, 1)); 147 description2, 1));
148 } 148 }
OLDNEW
« no previous file with comments | « chrome/common/win_safe_util.cc ('k') | chrome/service/cloud_print/print_system_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698