OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 #include <windows.h> | 4 #include <windows.h> |
5 #include <stdarg.h> | 5 #include <stdarg.h> |
6 | 6 |
7 // IShellWindows includes. Unfortunately we can't keep these in | 7 // IShellWindows includes. Unfortunately we can't keep these in |
8 // alphabetic order since exdisp will bark if some interfaces aren't fully | 8 // alphabetic order since exdisp will bark if some interfaces aren't fully |
9 // defined. | 9 // defined. |
10 #include <mshtml.h> | 10 #include <mshtml.h> |
(...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
790 } | 790 } |
791 | 791 |
792 TEST_F(ChromeFrameTestWithWebServer, WidgetModeOpera_PrivilegedApis) { | 792 TEST_F(ChromeFrameTestWithWebServer, WidgetModeOpera_PrivilegedApis) { |
793 OptionalBrowserTest(OPERA, kPrivilegedApisPage, L"PrivilegedApis"); | 793 OptionalBrowserTest(OPERA, kPrivilegedApisPage, L"PrivilegedApis"); |
794 } | 794 } |
795 | 795 |
796 class ChromeFrameTestEnvironment: public testing::Environment { | 796 class ChromeFrameTestEnvironment: public testing::Environment { |
797 public: | 797 public: |
798 ~ChromeFrameTestEnvironment() { | 798 ~ChromeFrameTestEnvironment() { |
799 } | 799 } |
800 | 800 |
801 void SetUp() { | 801 void SetUp() { |
802 ScopedChromeFrameRegistrar::RegisterDefaults(); | 802 ScopedChromeFrameRegistrar::RegisterDefaults(); |
803 } | 803 } |
804 | 804 |
805 void TearDown() { | 805 void TearDown() { |
806 } | 806 } |
807 }; | 807 }; |
808 | 808 |
809 ::testing::Environment* const chrome_frame_env = | 809 ::testing::Environment* const chrome_frame_env = |
810 ::testing::AddGlobalTestEnvironment(new ChromeFrameTestEnvironment); | 810 ::testing::AddGlobalTestEnvironment(new ChromeFrameTestEnvironment); |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
981 void ForwardTo(MockAutomationProxy *p) { | 981 void ForwardTo(MockAutomationProxy *p) { |
982 proxy_ = p; | 982 proxy_ = p; |
983 ON_CALL(*this, Send(testing::_)) | 983 ON_CALL(*this, Send(testing::_)) |
984 .WillByDefault(testing::Invoke(proxy_, &MockAutomationProxy::Send)); | 984 .WillByDefault(testing::Invoke(proxy_, &MockAutomationProxy::Send)); |
985 } | 985 } |
986 | 986 |
987 MockAutomationProxy* proxy_; | 987 MockAutomationProxy* proxy_; |
988 }; | 988 }; |
989 | 989 |
990 template <> struct RunnableMethodTraits<ProxyFactory::LaunchDelegate> { | 990 template <> struct RunnableMethodTraits<ProxyFactory::LaunchDelegate> { |
991 static void RetainCallee(ProxyFactory::LaunchDelegate* obj) {} | 991 void RetainCallee(ProxyFactory::LaunchDelegate* obj) {} |
992 static void ReleaseCallee(ProxyFactory::LaunchDelegate* obj) {} | 992 void ReleaseCallee(ProxyFactory::LaunchDelegate* obj) {} |
993 }; | 993 }; |
994 | 994 |
995 template <> struct RunnableMethodTraits<MockProxyFactory> { | 995 template <> struct RunnableMethodTraits<MockProxyFactory> { |
996 static void RetainCallee(MockProxyFactory* obj) {} | 996 void RetainCallee(MockProxyFactory* obj) {} |
997 static void ReleaseCallee(MockProxyFactory* obj) {} | 997 void ReleaseCallee(MockProxyFactory* obj) {} |
998 }; | 998 }; |
999 | 999 |
1000 template <> struct RunnableMethodTraits<ChromeFrameAutomationClient> { | 1000 template <> struct RunnableMethodTraits<ChromeFrameAutomationClient> { |
1001 static void RetainCallee(ChromeFrameAutomationClient* obj) {} | 1001 void RetainCallee(ChromeFrameAutomationClient* obj) {} |
1002 static void ReleaseCallee(ChromeFrameAutomationClient* obj) {} | 1002 void ReleaseCallee(ChromeFrameAutomationClient* obj) {} |
1003 }; | 1003 }; |
1004 | 1004 |
1005 // MessageLoopForUI wrapper that runs only for a limited time. | 1005 // MessageLoopForUI wrapper that runs only for a limited time. |
1006 // We need a UI message loop in the main thread. | 1006 // We need a UI message loop in the main thread. |
1007 struct TimedMsgLoop { | 1007 struct TimedMsgLoop { |
1008 public: | 1008 public: |
1009 void RunFor(int seconds) { | 1009 void RunFor(int seconds) { |
1010 loop_.PostDelayedTask(FROM_HERE, new MessageLoop::QuitTask, 1000 * seconds); | 1010 loop_.PostDelayedTask(FROM_HERE, new MessageLoop::QuitTask, 1000 * seconds); |
1011 loop_.MessageLoop::Run(); | 1011 loop_.MessageLoop::Run(); |
1012 } | 1012 } |
1013 | 1013 |
1014 void Quit() { | 1014 void Quit() { |
1015 loop_.PostTask(FROM_HERE, new MessageLoop::QuitTask); | 1015 loop_.PostTask(FROM_HERE, new MessageLoop::QuitTask); |
1016 } | 1016 } |
1017 | 1017 |
1018 MessageLoopForUI loop_; | 1018 MessageLoopForUI loop_; |
1019 }; | 1019 }; |
1020 | 1020 |
1021 template <> struct RunnableMethodTraits<TimedMsgLoop> { | 1021 template <> struct RunnableMethodTraits<TimedMsgLoop> { |
1022 static void RetainCallee(TimedMsgLoop* obj) {} | 1022 void RetainCallee(TimedMsgLoop* obj) {} |
1023 static void ReleaseCallee(TimedMsgLoop* obj) {} | 1023 void ReleaseCallee(TimedMsgLoop* obj) {} |
1024 }; | 1024 }; |
1025 | 1025 |
1026 // Saves typing. It's somewhat hard to create a wrapper around | 1026 // Saves typing. It's somewhat hard to create a wrapper around |
1027 // testing::InvokeWithoutArgs since it returns a | 1027 // testing::InvokeWithoutArgs since it returns a |
1028 // non-public (testing::internal) type. | 1028 // non-public (testing::internal) type. |
1029 #define QUIT_LOOP(loop) testing::InvokeWithoutArgs(TaskHolder(\ | 1029 #define QUIT_LOOP(loop) testing::InvokeWithoutArgs(TaskHolder(\ |
1030 NewRunnableMethod(&loop, &TimedMsgLoop::Quit))) | 1030 NewRunnableMethod(&loop, &TimedMsgLoop::Quit))) |
1031 | 1031 |
1032 // We mock ChromeFrameDelegate only. The rest is with real AutomationProxy | 1032 // We mock ChromeFrameDelegate only. The rest is with real AutomationProxy |
1033 TEST(CFACWithChrome, CreateTooFast) { | 1033 TEST(CFACWithChrome, CreateTooFast) { |
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1501 EXPECT_TRUE(hr == S_OK); | 1501 EXPECT_TRUE(hr == S_OK); |
1502 | 1502 |
1503 web_browser2.Release(); | 1503 web_browser2.Release(); |
1504 chrome_frame_test::CloseAllIEWindows(); | 1504 chrome_frame_test::CloseAllIEWindows(); |
1505 | 1505 |
1506 if (should_uninit) { | 1506 if (should_uninit) { |
1507 CoUninitialize(); | 1507 CoUninitialize(); |
1508 } | 1508 } |
1509 } | 1509 } |
1510 | 1510 |
OLD | NEW |