| 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
| 10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
| (...skipping 1059 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1070 new_model->GetWebContentsAt(2)->GetURL()); | 1070 new_model->GetWebContentsAt(2)->GetURL()); |
| 1071 | 1071 |
| 1072 EXPECT_TRUE( | 1072 EXPECT_TRUE( |
| 1073 extensions::TabHelper::FromWebContents( | 1073 extensions::TabHelper::FromWebContents( |
| 1074 new_model->GetWebContentsAt(0))->extension_app() == extension_app); | 1074 new_model->GetWebContentsAt(0))->extension_app() == extension_app); |
| 1075 } | 1075 } |
| 1076 #endif // !defined(OS_CHROMEOS) | 1076 #endif // !defined(OS_CHROMEOS) |
| 1077 | 1077 |
| 1078 // This test verifies we don't crash when closing the last window and the app | 1078 // This test verifies we don't crash when closing the last window and the app |
| 1079 // menu is showing. | 1079 // menu is showing. |
| 1080 IN_PROC_BROWSER_TEST_F(BrowserTest, CloseWithAppMenuOpen) { | 1080 // TODO(linux_aura) http://crbug.com/163931 |
| 1081 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(USE_AURA) |
| 1082 #define MAYBE_CloseWithAppMenuOpen DISABLED_CloseWithAppMenuOpen |
| 1083 #else |
| 1084 #define MAYBE_CloseWithAppMenuOpen CloseWithAppMenuOpen |
| 1085 #endif |
| 1086 IN_PROC_BROWSER_TEST_F(BrowserTest, MAYBE_CloseWithAppMenuOpen) { |
| 1081 if (browser_defaults::kBrowserAliveWithNoWindows) | 1087 if (browser_defaults::kBrowserAliveWithNoWindows) |
| 1082 return; | 1088 return; |
| 1083 | 1089 |
| 1084 // We need a message loop running for menus on windows. | 1090 // We need a message loop running for menus on windows. |
| 1085 MessageLoop::current()->PostTask( | 1091 MessageLoop::current()->PostTask( |
| 1086 FROM_HERE, base::Bind(&RunCloseWithAppMenuCallback, browser())); | 1092 FROM_HERE, base::Bind(&RunCloseWithAppMenuCallback, browser())); |
| 1087 } | 1093 } |
| 1088 | 1094 |
| 1089 #if !defined(OS_MACOSX) | 1095 #if !defined(OS_MACOSX) |
| 1090 IN_PROC_BROWSER_TEST_F(BrowserTest, OpenAppWindowLikeNtp) { | 1096 IN_PROC_BROWSER_TEST_F(BrowserTest, OpenAppWindowLikeNtp) { |
| (...skipping 853 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1944 #else | 1950 #else |
| 1945 int modifiers = WebKit::WebInputEvent::ControlKey; | 1951 int modifiers = WebKit::WebInputEvent::ControlKey; |
| 1946 #endif | 1952 #endif |
| 1947 modifiers |= WebKit::WebInputEvent::ShiftKey; | 1953 modifiers |= WebKit::WebInputEvent::ShiftKey; |
| 1948 WebKit::WebMouseEvent::Button button = WebKit::WebMouseEvent::ButtonLeft; | 1954 WebKit::WebMouseEvent::Button button = WebKit::WebMouseEvent::ButtonLeft; |
| 1949 WindowOpenDisposition disposition = NEW_FOREGROUND_TAB; | 1955 WindowOpenDisposition disposition = NEW_FOREGROUND_TAB; |
| 1950 RunTest(browser(), GetWindowOpenURL(), modifiers, button, disposition); | 1956 RunTest(browser(), GetWindowOpenURL(), modifiers, button, disposition); |
| 1951 } | 1957 } |
| 1952 | 1958 |
| 1953 // Middle-clicks open in a background tab. | 1959 // Middle-clicks open in a background tab. |
| 1954 IN_PROC_BROWSER_TEST_F(ClickModifierTest, WindowOpenMiddleClickTest) { | 1960 // TODO(linux_aura) http://crbug.com/163931 |
| 1961 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(USE_AURA) |
| 1962 #define MAYBE_WindowOpenMiddleClickTest DISABLED_WindowOpenMiddleClickTest |
| 1963 #else |
| 1964 #define MAYBE_WindowOpenMiddleClickTest WindowOpenMiddleClickTest |
| 1965 #endif |
| 1966 IN_PROC_BROWSER_TEST_F(ClickModifierTest, MAYBE_WindowOpenMiddleClickTest) { |
| 1955 int modifiers = 0; | 1967 int modifiers = 0; |
| 1956 WebKit::WebMouseEvent::Button button = WebKit::WebMouseEvent::ButtonMiddle; | 1968 WebKit::WebMouseEvent::Button button = WebKit::WebMouseEvent::ButtonMiddle; |
| 1957 WindowOpenDisposition disposition = NEW_BACKGROUND_TAB; | 1969 WindowOpenDisposition disposition = NEW_BACKGROUND_TAB; |
| 1958 RunTest(browser(), GetWindowOpenURL(), modifiers, button, disposition); | 1970 RunTest(browser(), GetWindowOpenURL(), modifiers, button, disposition); |
| 1959 } | 1971 } |
| 1960 | 1972 |
| 1961 // Shift-middle-clicks open in a foreground tab. | 1973 // Shift-middle-clicks open in a foreground tab. |
| 1962 IN_PROC_BROWSER_TEST_F(ClickModifierTest, WindowOpenShiftMiddleClickTest) { | 1974 IN_PROC_BROWSER_TEST_F(ClickModifierTest, WindowOpenShiftMiddleClickTest) { |
| 1963 int modifiers = WebKit::WebInputEvent::ShiftKey; | 1975 int modifiers = WebKit::WebInputEvent::ShiftKey; |
| 1964 WebKit::WebMouseEvent::Button button = WebKit::WebMouseEvent::ButtonMiddle; | 1976 WebKit::WebMouseEvent::Button button = WebKit::WebMouseEvent::ButtonMiddle; |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2007 #else | 2019 #else |
| 2008 int modifiers = WebKit::WebInputEvent::ControlKey; | 2020 int modifiers = WebKit::WebInputEvent::ControlKey; |
| 2009 #endif | 2021 #endif |
| 2010 modifiers |= WebKit::WebInputEvent::ShiftKey; | 2022 modifiers |= WebKit::WebInputEvent::ShiftKey; |
| 2011 WebKit::WebMouseEvent::Button button = WebKit::WebMouseEvent::ButtonLeft; | 2023 WebKit::WebMouseEvent::Button button = WebKit::WebMouseEvent::ButtonLeft; |
| 2012 WindowOpenDisposition disposition = NEW_FOREGROUND_TAB; | 2024 WindowOpenDisposition disposition = NEW_FOREGROUND_TAB; |
| 2013 RunTest(browser(), GetHrefURL(), modifiers, button, disposition); | 2025 RunTest(browser(), GetHrefURL(), modifiers, button, disposition); |
| 2014 } | 2026 } |
| 2015 | 2027 |
| 2016 // Middle-clicks open in a background tab. | 2028 // Middle-clicks open in a background tab. |
| 2017 IN_PROC_BROWSER_TEST_F(ClickModifierTest, HrefMiddleClickTest) { | 2029 // TODO(linux_aura) http://crbug.com/163931 |
| 2030 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(USE_AURA) |
| 2031 #define MAYBE_HrefMiddleClickTest DISABLED_HrefMiddleClickTest |
| 2032 #else |
| 2033 #define MAYBE_HrefMiddleClickTest HrefMiddleClickTest |
| 2034 #endif |
| 2035 IN_PROC_BROWSER_TEST_F(ClickModifierTest, MAYBE_HrefMiddleClickTest) { |
| 2018 int modifiers = 0; | 2036 int modifiers = 0; |
| 2019 WebKit::WebMouseEvent::Button button = WebKit::WebMouseEvent::ButtonMiddle; | 2037 WebKit::WebMouseEvent::Button button = WebKit::WebMouseEvent::ButtonMiddle; |
| 2020 WindowOpenDisposition disposition = NEW_BACKGROUND_TAB; | 2038 WindowOpenDisposition disposition = NEW_BACKGROUND_TAB; |
| 2021 RunTest(browser(), GetHrefURL(), modifiers, button, disposition); | 2039 RunTest(browser(), GetHrefURL(), modifiers, button, disposition); |
| 2022 } | 2040 } |
| 2023 | 2041 |
| 2024 // Shift-middle-clicks open in a foreground tab. | 2042 // Shift-middle-clicks open in a foreground tab. |
| 2025 IN_PROC_BROWSER_TEST_F(ClickModifierTest, HrefShiftMiddleClickTest) { | 2043 IN_PROC_BROWSER_TEST_F(ClickModifierTest, HrefShiftMiddleClickTest) { |
| 2026 int modifiers = WebKit::WebInputEvent::ShiftKey; | 2044 int modifiers = WebKit::WebInputEvent::ShiftKey; |
| 2027 WebKit::WebMouseEvent::Button button = WebKit::WebMouseEvent::ButtonMiddle; | 2045 WebKit::WebMouseEvent::Button button = WebKit::WebMouseEvent::ButtonMiddle; |
| 2028 WindowOpenDisposition disposition = NEW_FOREGROUND_TAB; | 2046 WindowOpenDisposition disposition = NEW_FOREGROUND_TAB; |
| 2029 RunTest(browser(), GetHrefURL(), modifiers, button, disposition); | 2047 RunTest(browser(), GetHrefURL(), modifiers, button, disposition); |
| 2030 } | 2048 } |
| OLD | NEW |