OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
9 #if defined(OS_MACOSX) | 9 #if defined(OS_MACOSX) |
10 #include "base/mac/mac_util.h" | 10 #include "base/mac/mac_util.h" |
(...skipping 1149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1160 content::NOTIFICATION_LOAD_STOP, | 1160 content::NOTIFICATION_LOAD_STOP, |
1161 content::Source<NavigationController>( | 1161 content::Source<NavigationController>( |
1162 &browser()->GetSelectedTabContents()->controller())); | 1162 &browser()->GetSelectedTabContents()->controller())); |
1163 browser()->GoForward(CURRENT_TAB); | 1163 browser()->GoForward(CURRENT_TAB); |
1164 // This check will happen before the navigation completes, since the browser | 1164 // This check will happen before the navigation completes, since the browser |
1165 // won't process the renderer's response until the Wait() call below. | 1165 // won't process the renderer's response until the Wait() call below. |
1166 EXPECT_FALSE(browser()->command_updater()->IsCommandEnabled(IDC_FORWARD)); | 1166 EXPECT_FALSE(browser()->command_updater()->IsCommandEnabled(IDC_FORWARD)); |
1167 forward_nav_load_observer.Wait(); | 1167 forward_nav_load_observer.Wait(); |
1168 } | 1168 } |
1169 | 1169 |
| 1170 #if defined(OS_WIN) |
| 1171 // see http://crbug.com/105306 |
| 1172 #define MAYBE_DisableMenuItemsWhenIncognitoIsForced \ |
| 1173 FLAKY_DisableMenuItemsWhenIncognitoIsForced |
| 1174 #else |
| 1175 #define MAYBE_DisableMenuItemsWhenIncognitoIsForced \ |
| 1176 DisableMenuItemsWhenIncognitoIsForced |
| 1177 #endif |
| 1178 |
1170 // Makes sure certain commands are disabled when Incognito mode is forced. | 1179 // Makes sure certain commands are disabled when Incognito mode is forced. |
1171 IN_PROC_BROWSER_TEST_F(BrowserTest, DisableMenuItemsWhenIncognitoIsForced) { | 1180 IN_PROC_BROWSER_TEST_F(BrowserTest, |
| 1181 MAYBE_DisableMenuItemsWhenIncognitoIsForced) { |
1172 CommandUpdater* command_updater = browser()->command_updater(); | 1182 CommandUpdater* command_updater = browser()->command_updater(); |
1173 // At the beginning, all commands are enabled. | 1183 // At the beginning, all commands are enabled. |
1174 EXPECT_TRUE(command_updater->IsCommandEnabled(IDC_NEW_WINDOW)); | 1184 EXPECT_TRUE(command_updater->IsCommandEnabled(IDC_NEW_WINDOW)); |
1175 EXPECT_TRUE(command_updater->IsCommandEnabled(IDC_NEW_INCOGNITO_WINDOW)); | 1185 EXPECT_TRUE(command_updater->IsCommandEnabled(IDC_NEW_INCOGNITO_WINDOW)); |
1176 EXPECT_TRUE(command_updater->IsCommandEnabled(IDC_SHOW_BOOKMARK_MANAGER)); | 1186 EXPECT_TRUE(command_updater->IsCommandEnabled(IDC_SHOW_BOOKMARK_MANAGER)); |
1177 EXPECT_TRUE(command_updater->IsCommandEnabled(IDC_IMPORT_SETTINGS)); | 1187 EXPECT_TRUE(command_updater->IsCommandEnabled(IDC_IMPORT_SETTINGS)); |
1178 EXPECT_TRUE(command_updater->IsCommandEnabled(IDC_MANAGE_EXTENSIONS)); | 1188 EXPECT_TRUE(command_updater->IsCommandEnabled(IDC_MANAGE_EXTENSIONS)); |
1179 EXPECT_TRUE(command_updater->IsCommandEnabled(IDC_OPTIONS)); | 1189 EXPECT_TRUE(command_updater->IsCommandEnabled(IDC_OPTIONS)); |
1180 | 1190 |
1181 // Set Incognito to FORCED. | 1191 // Set Incognito to FORCED. |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1397 | 1407 |
1398 // The normal browser should now have four. | 1408 // The normal browser should now have four. |
1399 EXPECT_EQ(4, browser()->tab_count()); | 1409 EXPECT_EQ(4, browser()->tab_count()); |
1400 | 1410 |
1401 // Close the additional browsers. | 1411 // Close the additional browsers. |
1402 popup_browser->CloseAllTabs(); | 1412 popup_browser->CloseAllTabs(); |
1403 app_browser->CloseAllTabs(); | 1413 app_browser->CloseAllTabs(); |
1404 app_popup_browser->CloseAllTabs(); | 1414 app_popup_browser->CloseAllTabs(); |
1405 } | 1415 } |
1406 #endif | 1416 #endif |
OLD | NEW |