| OLD | NEW |
| 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 "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/strings/string_number_conversions.h" | 6 #include "base/strings/string_number_conversions.h" |
| 7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "chrome/app/chrome_command_ids.h" | 8 #include "chrome/app/chrome_command_ids.h" |
| 9 #include "chrome/browser/tab_contents/render_view_context_menu.h" | 9 #include "chrome/browser/tab_contents/render_view_context_menu.h" |
| 10 #include "chrome/browser/tab_contents/render_view_context_menu_browsertest_util.
h" | 10 #include "chrome/browser/tab_contents/render_view_context_menu_browsertest_util.
h" |
| 11 #include "chrome/browser/ui/browser.h" | 11 #include "chrome/browser/ui/browser.h" |
| 12 #include "chrome/browser/ui/browser_commands.h" | 12 #include "chrome/browser/ui/browser_commands.h" |
| 13 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 13 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 14 #include "chrome/common/chrome_notification_types.h" | 14 #include "chrome/common/chrome_notification_types.h" |
| 15 #include "chrome/test/base/in_process_browser_test.h" | 15 #include "chrome/test/base/in_process_browser_test.h" |
| 16 #include "chrome/test/base/ui_test_utils.h" | 16 #include "chrome/test/base/ui_test_utils.h" |
| 17 #include "content/public/browser/notification_service.h" | 17 #include "content/public/browser/notification_service.h" |
| 18 #include "content/public/browser/render_view_host.h" | 18 #include "content/public/browser/render_view_host.h" |
| 19 #include "content/public/browser/web_contents.h" | 19 #include "content/public/browser/web_contents.h" |
| 20 #include "content/public/test/browser_test_utils.h" | 20 #include "content/public/test/browser_test_utils.h" |
| 21 #include "net/test/spawned_test_server.h" | 21 #include "net/test/spawned_test_server.h" |
| 22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" | 22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" |
| 23 | 23 |
| 24 // GTK requires a X11-level mouse event to open a context menu correctly. | 24 // GTK requires a X11-level mouse event to open a context menu correctly. |
| 25 #if defined(TOOLKIT_GTK) | 25 #if defined(TOOLKIT_GTK) |
| 26 #define MAYBE_ContextMenuOrigin DISABLED_ContextMenuOrigin | 26 #define MAYBE_ContextMenuOrigin DISABLED_ContextMenuOrigin |
| 27 #define MAYBE_HttpsContextMenuOrigin DISABLED_HttpsContextMenuOrigin | 27 #define MAYBE_HttpsContextMenuOrigin DISABLED_HttpsContextMenuOrigin |
| 28 #define MAYBE_ContextMenuRedirect DISABLED_ContextMenuRedirect | 28 #define MAYBE_ContextMenuRedirect DISABLED_ContextMenuRedirect |
| 29 #define MAYBE_HttpsContextMenuRedirect DISABLED_HttpsContextMenuRedirect | 29 #define MAYBE_HttpsContextMenuRedirect DISABLED_HttpsContextMenuRedirect |
| 30 #elif defined(OS_CHROMEOS) | |
| 31 // Flaky on linux_chromeos try bot. http://crbug.com/237819 | |
| 32 #define MAYBE_ContextMenuOrigin DISABLED_ContextMenuOrigin | |
| 33 #define MAYBE_HttpsContextMenuOrigin DISABLED_HttpsContextMenuOrigin | |
| 34 #define MAYBE_ContextMenuRedirect DISABLED_ContextMenuRedirect | |
| 35 #define MAYBE_HttpsContextMenuRedirect DISABLED_HttpsContextMenuRedirect | |
| 36 #else | 30 #else |
| 37 #define MAYBE_ContextMenuOrigin ContextMenuOrigin | 31 #define MAYBE_ContextMenuOrigin ContextMenuOrigin |
| 38 #define MAYBE_HttpsContextMenuOrigin HttpsContextMenuOrigin | 32 #define MAYBE_HttpsContextMenuOrigin HttpsContextMenuOrigin |
| 39 #define MAYBE_ContextMenuRedirect ContextMenuRedirect | 33 #define MAYBE_ContextMenuRedirect ContextMenuRedirect |
| 40 #define MAYBE_HttpsContextMenuRedirect HttpsContextMenuRedirect | 34 #define MAYBE_HttpsContextMenuRedirect HttpsContextMenuRedirect |
| 41 #endif | 35 #endif |
| 42 | 36 |
| 43 namespace { | 37 namespace { |
| 44 | 38 |
| 45 const base::FilePath::CharType kDocRoot[] = | 39 const base::FilePath::CharType kDocRoot[] = |
| (...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 407 chrome::Reload(browser(), CURRENT_TAB); | 401 chrome::Reload(browser(), CURRENT_TAB); |
| 408 EXPECT_EQ(expected_title, title_watcher->WaitAndGetTitle()); | 402 EXPECT_EQ(expected_title, title_watcher->WaitAndGetTitle()); |
| 409 | 403 |
| 410 title_watcher.reset(new content::TitleWatcher(tab, expected_title)); | 404 title_watcher.reset(new content::TitleWatcher(tab, expected_title)); |
| 411 AddAllPossibleTitles(start_url, title_watcher.get()); | 405 AddAllPossibleTitles(start_url, title_watcher.get()); |
| 412 | 406 |
| 413 // Shift-reload to B. | 407 // Shift-reload to B. |
| 414 chrome::ReloadIgnoringCache(browser(), CURRENT_TAB); | 408 chrome::ReloadIgnoringCache(browser(), CURRENT_TAB); |
| 415 EXPECT_EQ(expected_title, title_watcher->WaitAndGetTitle()); | 409 EXPECT_EQ(expected_title, title_watcher->WaitAndGetTitle()); |
| 416 } | 410 } |
| OLD | NEW |