OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 mouse_event.button = blink::WebMouseEvent::ButtonRight; | 259 mouse_event.button = blink::WebMouseEvent::ButtonRight; |
260 mouse_event.x = 15; | 260 mouse_event.x = 15; |
261 mouse_event.y = 15; | 261 mouse_event.y = 15; |
262 content::WebContents* tab = | 262 content::WebContents* tab = |
263 browser()->tab_strip_model()->GetActiveWebContents(); | 263 browser()->tab_strip_model()->GetActiveWebContents(); |
264 tab->GetRenderViewHost()->ForwardMouseEvent(mouse_event); | 264 tab->GetRenderViewHost()->ForwardMouseEvent(mouse_event); |
265 mouse_event.type = blink::WebInputEvent::MouseUp; | 265 mouse_event.type = blink::WebInputEvent::MouseUp; |
266 tab->GetRenderViewHost()->ForwardMouseEvent(mouse_event); | 266 tab->GetRenderViewHost()->ForwardMouseEvent(mouse_event); |
267 | 267 |
268 // Wait for context menu to be visible. | 268 // Wait for context menu to be visible. |
269 menu_observer.WaitForMenu(); | 269 menu_observer.WaitForMenuOpenAndClose(); |
270 | 270 |
271 // Compare filename. | 271 // Compare filename. |
272 base::string16 suggested_filename = menu_observer.GetSuggestedFilename(); | 272 base::string16 suggested_filename = menu_observer.params().suggested_filename; |
273 ASSERT_EQ(kSuggestedFilename, base::UTF16ToUTF8(suggested_filename).c_str()); | 273 ASSERT_EQ(kSuggestedFilename, base::UTF16ToUTF8(suggested_filename).c_str()); |
274 } | 274 } |
275 | 275 |
276 // Ensure that View Page Info won't crash if there is no visible entry. | 276 // Ensure that View Page Info won't crash if there is no visible entry. |
277 // See http://crbug.com/370863. | 277 // See http://crbug.com/370863. |
278 IN_PROC_BROWSER_TEST_F(ContextMenuBrowserTest, ViewPageInfoWithNoEntry) { | 278 IN_PROC_BROWSER_TEST_F(ContextMenuBrowserTest, ViewPageInfoWithNoEntry) { |
279 // Create a new tab with no committed entry. | 279 // Create a new tab with no committed entry. |
280 ui_test_utils::WindowedTabAddedNotificationObserver tab_observer( | 280 ui_test_utils::WindowedTabAddedNotificationObserver tab_observer( |
281 content::NotificationService::AllSources()); | 281 content::NotificationService::AllSources()); |
282 ASSERT_TRUE(content::ExecuteScript( | 282 ASSERT_TRUE(content::ExecuteScript( |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
471 browser()->tab_strip_model()->GetActiveWebContents(); | 471 browser()->tab_strip_model()->GetActiveWebContents(); |
472 ThumbnailResponseWatcher watcher(tab->GetRenderProcessHost()); | 472 ThumbnailResponseWatcher watcher(tab->GetRenderProcessHost()); |
473 AttemptImageSearch(); | 473 AttemptImageSearch(); |
474 | 474 |
475 // The browser should receive a response from the renderer, because the | 475 // The browser should receive a response from the renderer, because the |
476 // renderer should not crash. | 476 // renderer should not crash. |
477 EXPECT_EQ(ThumbnailResponseWatcher::THUMBNAIL_RECEIVED, watcher.Wait()); | 477 EXPECT_EQ(ThumbnailResponseWatcher::THUMBNAIL_RECEIVED, watcher.Wait()); |
478 } | 478 } |
479 | 479 |
480 } // namespace | 480 } // namespace |
OLD | NEW |