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

Unified Diff: net/url_request/url_request_unittest.cc

Issue 10991052: Miscellaneous tiny cleanups done while converting files to use ScopedCOMInitializer, pulled out sep… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: net/url_request/url_request_unittest.cc
===================================================================
--- net/url_request/url_request_unittest.cc (revision 158860)
+++ net/url_request/url_request_unittest.cc (working copy)
@@ -702,25 +702,19 @@
std::wstring lnk_path = app_path.value() + L".lnk";
- HRESULT result;
+ CoInitialize(NULL);
Ryan Sleevi 2012/10/01 14:21:01 According to the e-mail that went out, there shoul
Peter Kasting 2012/10/01 18:18:55 I am in fact going to change this to ScopedCOMInit
Ryan Sleevi 2012/10/01 20:54:43 For some reason, I thought there were more places
+
+ // Temporarily create a shortcut for test
IShellLink* shell = NULL;
+ ASSERT_TRUE(SUCCEEDED(CoCreateInstance(
+ CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_IShellLink,
+ reinterpret_cast<LPVOID*>(&shell))));
IPersistFile* persist = NULL;
-
- CoInitialize(NULL);
- // Temporarily create a shortcut for test
- result = CoCreateInstance(CLSID_ShellLink, NULL,
- CLSCTX_INPROC_SERVER, IID_IShellLink,
- reinterpret_cast<LPVOID*>(&shell));
- ASSERT_TRUE(SUCCEEDED(result));
- result = shell->QueryInterface(IID_IPersistFile,
- reinterpret_cast<LPVOID*>(&persist));
- ASSERT_TRUE(SUCCEEDED(result));
- result = shell->SetPath(app_path.value().c_str());
- EXPECT_TRUE(SUCCEEDED(result));
- result = shell->SetDescription(L"ResolveShortcutTest");
- EXPECT_TRUE(SUCCEEDED(result));
- result = persist->Save(lnk_path.c_str(), TRUE);
- EXPECT_TRUE(SUCCEEDED(result));
+ ASSERT_TRUE(SUCCEEDED(shell->QueryInterface(
+ IID_IPersistFile, reinterpret_cast<LPVOID*>(&persist))));
+ EXPECT_TRUE(SUCCEEDED(shell->SetPath(app_path.value().c_str())));
+ EXPECT_TRUE(SUCCEEDED(shell->SetDescription(L"ResolveShortcutTest")));
+ EXPECT_TRUE(SUCCEEDED(persist->Save(lnk_path.c_str(), TRUE)));
if (persist)
persist->Release();
if (shell)

Powered by Google App Engine
This is Rietveld 408576698