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

Side by Side Diff: chrome_frame/test/chrome_frame_test_utils.cc

Issue 10197011: Share the "get CF profile dir" code between ChromeFramePlugin and chrome_frame_test_utils.h. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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
OLDNEW
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 "chrome_frame/test/chrome_frame_test_utils.h" 5 #include "chrome_frame/test/chrome_frame_test_utils.h"
6 6
7 #include <atlapp.h> 7 #include <atlapp.h>
8 #include <atlmisc.h> 8 #include <atlmisc.h>
9 #include <iepmapi.h> 9 #include <iepmapi.h>
10 #include <sddl.h> 10 #include <sddl.h>
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 cocreate_flags |= CLSCTX_ENABLE_CLOAKING; 406 cocreate_flags |= CLSCTX_ENABLE_CLOAKING;
407 } 407 }
408 408
409 hr = ::CoCreateInstance(CLSID_InternetExplorer, NULL, 409 hr = ::CoCreateInstance(CLSID_InternetExplorer, NULL,
410 cocreate_flags, IID_IWebBrowser2, 410 cocreate_flags, IID_IWebBrowser2,
411 reinterpret_cast<void**>(web_browser)); 411 reinterpret_cast<void**>(web_browser));
412 // ~LowIntegrityToken() will switch integrity back to medium. 412 // ~LowIntegrityToken() will switch integrity back to medium.
413 return hr; 413 return hr;
414 } 414 }
415 415
416 // TODO(joi@chromium.org) Could share this code with chrome_frame_plugin.h
417 FilePath GetProfilePath(const std::wstring& profile_name) {
418 FilePath profile_path;
419 chrome::GetChromeFrameUserDataDirectory(&profile_path);
420 return profile_path.Append(profile_name);
421 }
422
423 std::wstring GetExeVersion(const std::wstring& exe_path) { 416 std::wstring GetExeVersion(const std::wstring& exe_path) {
424 scoped_ptr<FileVersionInfo> ie_version_info( 417 scoped_ptr<FileVersionInfo> ie_version_info(
425 FileVersionInfo::CreateFileVersionInfo(FilePath(exe_path))); 418 FileVersionInfo::CreateFileVersionInfo(FilePath(exe_path)));
426 return ie_version_info->product_version(); 419 return ie_version_info->product_version();
427 } 420 }
428 421
429 IEVersion GetInstalledIEVersion() { 422 IEVersion GetInstalledIEVersion() {
430 std::wstring path = chrome_frame_test::GetExecutableAppPath(kIEImageName); 423 std::wstring path = chrome_frame_test::GetExecutableAppPath(kIEImageName);
431 std::wstring version = GetExeVersion(path); 424 std::wstring version = GetExeVersion(path);
432 425
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
707 if (address.empty()) { 700 if (address.empty()) {
708 LOG(ERROR) << "Failed to find a non-loopback IP_V4 address. Tests will be " 701 LOG(ERROR) << "Failed to find a non-loopback IP_V4 address. Tests will be "
709 << "run over the loopback adapter, which may result in hangs."; 702 << "run over the loopback adapter, which may result in hangs.";
710 address.assign("127.0.0.1"); 703 address.assign("127.0.0.1");
711 } 704 }
712 705
713 return address; 706 return address;
714 } 707 }
715 708
716 } // namespace chrome_frame_test 709 } // namespace chrome_frame_test
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698