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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "chrome/browser/chromeos/wm_ipc.h" | 6 #include "chrome/browser/chromeos/wm_ipc.h" |
7 #include "chrome/browser/ui/browser.h" | 7 #include "chrome/browser/ui/browser.h" |
8 #include "chrome/browser/ui/browser_list.h" | 8 #include "chrome/browser/ui/browser_list.h" |
9 #include "chrome/browser/ui/browser_window.h" | 9 #include "chrome/browser/ui/browser_window.h" |
10 #include "chrome/common/chrome_switches.h" | 10 #include "chrome/common/chrome_switches.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 " }" | 38 " }" |
39 "</script>" | 39 "</script>" |
40 "</body></html>"; | 40 "</body></html>"; |
41 GURL url("data:text/html," + HTML); | 41 GURL url("data:text/html," + HTML); |
42 CommandLine::ForCurrentProcess()->AppendSwitch( | 42 CommandLine::ForCurrentProcess()->AppendSwitch( |
43 switches::kDisablePopupBlocking); | 43 switches::kDisablePopupBlocking); |
44 | 44 |
45 browser()->OpenURL(url, GURL(), CURRENT_TAB, PageTransition::TYPED); | 45 browser()->OpenURL(url, GURL(), CURRENT_TAB, PageTransition::TYPED); |
46 | 46 |
47 // Wait for notification that window.open has been processed. | 47 // Wait for notification that window.open has been processed. |
48 ui_test_utils::WaitForNotification(NotificationType::TAB_ADDED); | 48 ui_test_utils::WaitForNotification(content::NOTIFICATION_TAB_ADDED); |
49 | 49 |
50 // Find the new browser. | 50 // Find the new browser. |
51 Browser* new_browser = NULL; | 51 Browser* new_browser = NULL; |
52 for (BrowserList::const_iterator i = BrowserList::begin(); | 52 for (BrowserList::const_iterator i = BrowserList::begin(); |
53 i != BrowserList::end() && !new_browser; ++i) { | 53 i != BrowserList::end() && !new_browser; ++i) { |
54 if (*i != browser()) | 54 if (*i != browser()) |
55 new_browser = *i; | 55 new_browser = *i; |
56 } | 56 } |
57 | 57 |
58 ASSERT_TRUE(new_browser); | 58 ASSERT_TRUE(new_browser); |
(...skipping 18 matching lines...) Expand all Loading... |
77 " }" | 77 " }" |
78 "</script>" | 78 "</script>" |
79 "</body></html>"; | 79 "</body></html>"; |
80 GURL url("data:text/html," + HTML); | 80 GURL url("data:text/html," + HTML); |
81 CommandLine::ForCurrentProcess()->AppendSwitch( | 81 CommandLine::ForCurrentProcess()->AppendSwitch( |
82 switches::kDisablePopupBlocking); | 82 switches::kDisablePopupBlocking); |
83 int old_tab_count = browser()->tab_count(); | 83 int old_tab_count = browser()->tab_count(); |
84 browser()->OpenURL(url, GURL(), CURRENT_TAB, PageTransition::TYPED); | 84 browser()->OpenURL(url, GURL(), CURRENT_TAB, PageTransition::TYPED); |
85 | 85 |
86 // Wait for notification that window.open has been processed. | 86 // Wait for notification that window.open has been processed. |
87 ui_test_utils::WaitForNotification(NotificationType::TAB_ADDED); | 87 ui_test_utils::WaitForNotification(content::NOTIFICATION_TAB_ADDED); |
88 | 88 |
89 // Shouldn't find a new browser. | 89 // Shouldn't find a new browser. |
90 Browser* new_browser = NULL; | 90 Browser* new_browser = NULL; |
91 for (BrowserList::const_iterator i = BrowserList::begin(); | 91 for (BrowserList::const_iterator i = BrowserList::begin(); |
92 i != BrowserList::end() && !new_browser; ++i) { | 92 i != BrowserList::end() && !new_browser; ++i) { |
93 if (*i != browser()) | 93 if (*i != browser()) |
94 new_browser = *i; | 94 new_browser = *i; |
95 } | 95 } |
96 EXPECT_FALSE(new_browser); | 96 EXPECT_FALSE(new_browser); |
97 | 97 |
98 // Should find a new tab. | 98 // Should find a new tab. |
99 EXPECT_EQ(old_tab_count + 1, browser()->tab_count()); | 99 EXPECT_EQ(old_tab_count + 1, browser()->tab_count()); |
100 } | 100 } |
101 | 101 |
102 } // namespace chromeos | 102 } // namespace chromeos |
OLD | NEW |