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 #include <memory> | 5 #include <memory> |
6 #include <utility> | 6 #include <utility> |
7 | 7 |
8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 1253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1264 std::wstring lnk_path = app_path.value() + L".lnk"; | 1264 std::wstring lnk_path = app_path.value() + L".lnk"; |
1265 | 1265 |
1266 base::win::ScopedCOMInitializer com_initializer; | 1266 base::win::ScopedCOMInitializer com_initializer; |
1267 | 1267 |
1268 // Temporarily create a shortcut for test | 1268 // Temporarily create a shortcut for test |
1269 { | 1269 { |
1270 base::win::ScopedComPtr<IShellLink> shell; | 1270 base::win::ScopedComPtr<IShellLink> shell; |
1271 ASSERT_TRUE(SUCCEEDED(shell.CreateInstance(CLSID_ShellLink, NULL, | 1271 ASSERT_TRUE(SUCCEEDED(shell.CreateInstance(CLSID_ShellLink, NULL, |
1272 CLSCTX_INPROC_SERVER))); | 1272 CLSCTX_INPROC_SERVER))); |
1273 base::win::ScopedComPtr<IPersistFile> persist; | 1273 base::win::ScopedComPtr<IPersistFile> persist; |
1274 ASSERT_TRUE(SUCCEEDED(shell.CopyTo(persist.Receive()))); | 1274 ASSERT_TRUE(SUCCEEDED(shell.CopyTo(persist.GetAddressOf()))); |
1275 EXPECT_TRUE(SUCCEEDED(shell->SetPath(app_path.value().c_str()))); | 1275 EXPECT_TRUE(SUCCEEDED(shell->SetPath(app_path.value().c_str()))); |
1276 EXPECT_TRUE(SUCCEEDED(shell->SetDescription(L"ResolveShortcutTest"))); | 1276 EXPECT_TRUE(SUCCEEDED(shell->SetDescription(L"ResolveShortcutTest"))); |
1277 EXPECT_TRUE(SUCCEEDED(persist->Save(lnk_path.c_str(), TRUE))); | 1277 EXPECT_TRUE(SUCCEEDED(persist->Save(lnk_path.c_str(), TRUE))); |
1278 } | 1278 } |
1279 | 1279 |
1280 TestDelegate d; | 1280 TestDelegate d; |
1281 { | 1281 { |
1282 std::unique_ptr<URLRequest> r(default_context_.CreateRequest( | 1282 std::unique_ptr<URLRequest> r(default_context_.CreateRequest( |
1283 FilePathToFileURL(base::FilePath(lnk_path)), DEFAULT_PRIORITY, &d, | 1283 FilePathToFileURL(base::FilePath(lnk_path)), DEFAULT_PRIORITY, &d, |
1284 TRAFFIC_ANNOTATION_FOR_TESTS)); | 1284 TRAFFIC_ANNOTATION_FOR_TESTS)); |
(...skipping 9790 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11075 AddTestInterceptor()->set_main_intercept_job(std::move(job)); | 11075 AddTestInterceptor()->set_main_intercept_job(std::move(job)); |
11076 | 11076 |
11077 req->Start(); | 11077 req->Start(); |
11078 req->Cancel(); | 11078 req->Cancel(); |
11079 base::RunLoop().RunUntilIdle(); | 11079 base::RunLoop().RunUntilIdle(); |
11080 EXPECT_EQ(ERR_ABORTED, d.request_status()); | 11080 EXPECT_EQ(ERR_ABORTED, d.request_status()); |
11081 EXPECT_EQ(0, d.received_redirect_count()); | 11081 EXPECT_EQ(0, d.received_redirect_count()); |
11082 } | 11082 } |
11083 | 11083 |
11084 } // namespace net | 11084 } // namespace net |
OLD | NEW |