| OLD | NEW |
| 1 // Copyright (c) 2009 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 #include <atlbase.h> | 5 #include <atlbase.h> |
| 5 #include <atlwin.h> | 6 #include <atlwin.h> |
| 6 #include <atlhost.h> | 7 #include <atlhost.h> |
| 7 #include "base/scoped_comptr_win.h" | 8 |
| 9 #include "base/win/scoped_comptr.h" |
| 8 #include "chrome_frame/test/perf/chrome_frame_perftest.h" | 10 #include "chrome_frame/test/perf/chrome_frame_perftest.h" |
| 9 | 11 |
| 10 interface IXcpControlDownloadCallback; | 12 interface IXcpControlDownloadCallback; |
| 11 interface __declspec(uuid("1B36028E-B491-4bb2-8584-8A9E0A677D6E")) | 13 interface __declspec(uuid("1B36028E-B491-4bb2-8584-8A9E0A677D6E")) |
| 12 IXcpControlHost : public IUnknown { | 14 IXcpControlHost : public IUnknown { |
| 13 typedef enum { | 15 typedef enum { |
| 14 XcpHostOption_FreezeOnInitialFrame = 0x001, | 16 XcpHostOption_FreezeOnInitialFrame = 0x001, |
| 15 XcpHostOption_DisableFullScreen = 0x002, | 17 XcpHostOption_DisableFullScreen = 0x002, |
| 16 XcpHostOption_DisableManagedExecution = 0x008, | 18 XcpHostOption_DisableManagedExecution = 0x008, |
| 17 XcpHostOption_EnableCrossDomainDownloads = 0x010, | 19 XcpHostOption_EnableCrossDomainDownloads = 0x010, |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 } | 123 } |
| 122 return hr; | 124 return hr; |
| 123 } | 125 } |
| 124 | 126 |
| 125 HRESULT CreateControl() { | 127 HRESULT CreateControl() { |
| 126 HRESULT hr = host_->CreateControl(L"AgControl.AgControl", m_hWnd, NULL); | 128 HRESULT hr = host_->CreateControl(L"AgControl.AgControl", m_hWnd, NULL); |
| 127 EXPECT_HRESULT_SUCCEEDED(hr); | 129 EXPECT_HRESULT_SUCCEEDED(hr); |
| 128 return hr; | 130 return hr; |
| 129 } | 131 } |
| 130 | 132 |
| 131 ScopedComPtr<IAxWinHostWindow> host_; | 133 base::win::ScopedComPtr<IAxWinHostWindow> host_; |
| 132 }; | 134 }; |
| 133 | 135 |
| 134 // Create and in-place Silverlight control. Should be extended to do something | 136 // Create and in-place Silverlight control. Should be extended to do something |
| 135 // more meaningful. | 137 // more meaningful. |
| 136 TEST(ChromeFramePerf, DISABLED_HostSilverlight2) { | 138 TEST(ChromeFramePerf, DISABLED_HostSilverlight2) { |
| 137 SimpleModule module; | 139 SimpleModule module; |
| 138 AtlAxWinInit(); | 140 AtlAxWinInit(); |
| 139 CComObjectStackEx<SilverlightContainer> wnd; | 141 CComObjectStackEx<SilverlightContainer> wnd; |
| 140 RECT rc = {0, 0, 800, 600}; | 142 RECT rc = {0, 0, 800, 600}; |
| 141 wnd.CreateWndAndHost(&rc); | 143 wnd.CreateWndAndHost(&rc); |
| 142 PerfTimeLogger perf_create("Create Silverlight Control2"); | 144 PerfTimeLogger perf_create("Create Silverlight Control2"); |
| 143 wnd.CreateControl(); | 145 wnd.CreateControl(); |
| 144 perf_create.Done(); | 146 perf_create.Done(); |
| 145 wnd.DestroyWindow(); | 147 wnd.DestroyWindow(); |
| 146 } | 148 } |
| 147 | 149 |
| 148 // Simplest test - creates in-place Silverlight control. | 150 // Simplest test - creates in-place Silverlight control. |
| 149 TEST(ChromeFramePerf, DISABLED_HostSilverlight) { | 151 TEST(ChromeFramePerf, DISABLED_HostSilverlight) { |
| 150 SimpleModule module; | 152 SimpleModule module; |
| 151 AtlAxWinInit(); | 153 AtlAxWinInit(); |
| 152 CAxWindow host; | 154 CAxWindow host; |
| 153 RECT rc = {0, 0, 800, 600}; | 155 RECT rc = {0, 0, 800, 600}; |
| 154 PerfTimeLogger perf_create("Create Silverlight Control"); | 156 PerfTimeLogger perf_create("Create Silverlight Control"); |
| 155 host.Create(NULL, rc, L"AgControl.AgControl", | 157 host.Create(NULL, rc, L"AgControl.AgControl", |
| 156 WS_OVERLAPPEDWINDOW | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, | 158 WS_OVERLAPPEDWINDOW | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, |
| 157 WS_EX_APPWINDOW | WS_EX_WINDOWEDGE); | 159 WS_EX_APPWINDOW | WS_EX_WINDOWEDGE); |
| 158 EXPECT_TRUE(host.m_hWnd != NULL); | 160 EXPECT_TRUE(host.m_hWnd != NULL); |
| 159 ScopedComPtr<IDispatch> disp; | 161 base::win::ScopedComPtr<IDispatch> disp; |
| 160 HRESULT hr = host.QueryControl(disp.Receive()); | 162 HRESULT hr = host.QueryControl(disp.Receive()); |
| 161 EXPECT_HRESULT_SUCCEEDED(hr); | 163 EXPECT_HRESULT_SUCCEEDED(hr); |
| 162 disp.Release(); | 164 disp.Release(); |
| 163 perf_create.Done(); | 165 perf_create.Done(); |
| 164 } | 166 } |
| 165 | 167 |
| OLD | NEW |