OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 } | 95 } |
96 | 96 |
97 WebNavigationPolicy getNavigationPolicyWithMouseEvent(int modifiers, WebMous
eEvent::Button button, bool asPopup) | 97 WebNavigationPolicy getNavigationPolicyWithMouseEvent(int modifiers, WebMous
eEvent::Button button, bool asPopup) |
98 { | 98 { |
99 WebMouseEvent event; | 99 WebMouseEvent event; |
100 event.modifiers = modifiers; | 100 event.modifiers = modifiers; |
101 event.type = WebInputEvent::MouseUp; | 101 event.type = WebInputEvent::MouseUp; |
102 event.button = button; | 102 event.button = button; |
103 setCurrentInputEventForTest(&event); | 103 setCurrentInputEventForTest(&event); |
104 m_chromeClientImpl->setScrollbarsVisible(!asPopup); | 104 m_chromeClientImpl->setScrollbarsVisible(!asPopup); |
105 m_chromeClientImpl->show(NavigationPolicyIgnore); | 105 m_chromeClientImpl->show(NavigationPolicyIgnore, CreatedFromLoadRequest)
; |
106 setCurrentInputEventForTest(0); | 106 setCurrentInputEventForTest(0); |
107 return m_result; | 107 return m_result; |
108 } | 108 } |
109 | 109 |
110 bool isNavigationPolicyPopup() | 110 bool isNavigationPolicyPopup() |
111 { | 111 { |
112 m_chromeClientImpl->show(NavigationPolicyIgnore); | 112 m_chromeClientImpl->show(NavigationPolicyIgnore, CreatedFromLoadRequest)
; |
113 return m_result == WebNavigationPolicyNewPopup; | 113 return m_result == WebNavigationPolicyNewPopup; |
114 } | 114 } |
115 | 115 |
116 protected: | 116 protected: |
117 WebNavigationPolicy m_result; | 117 WebNavigationPolicy m_result; |
118 TestWebViewClient m_webViewClient; | 118 TestWebViewClient m_webViewClient; |
119 WebViewImpl* m_webView; | 119 WebViewImpl* m_webView; |
120 WebFrame* m_mainFrame; | 120 WebFrame* m_mainFrame; |
121 TestWebFrameClient m_webFrameClient; | 121 TestWebFrameClient m_webFrameClient; |
122 ChromeClientImpl* m_chromeClientImpl; | 122 ChromeClientImpl* m_chromeClientImpl; |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 | 256 |
257 TEST_F(GetNavigationPolicyTest, NotResizableForcesPopup) | 257 TEST_F(GetNavigationPolicyTest, NotResizableForcesPopup) |
258 { | 258 { |
259 m_chromeClientImpl->setResizable(false); | 259 m_chromeClientImpl->setResizable(false); |
260 EXPECT_TRUE(isNavigationPolicyPopup()); | 260 EXPECT_TRUE(isNavigationPolicyPopup()); |
261 m_chromeClientImpl->setResizable(true); | 261 m_chromeClientImpl->setResizable(true); |
262 EXPECT_FALSE(isNavigationPolicyPopup()); | 262 EXPECT_FALSE(isNavigationPolicyPopup()); |
263 } | 263 } |
264 | 264 |
265 } // namespace blink | 265 } // namespace blink |
OLD | NEW |