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 "chrome/browser/chromeos/tab_closeable_state_watcher.h" | 5 #include "chrome/browser/chromeos/tab_closeable_state_watcher.h" |
6 | 6 |
7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
9 #include "chrome/browser/tabs/tab_strip_model.h" | 9 #include "chrome/browser/tabs/tab_strip_model.h" |
10 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog.h" | 10 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 other_url_ = ui_test_utils::GetTestUrl( | 32 other_url_ = ui_test_utils::GetTestUrl( |
33 FilePath(FilePath::kCurrentDirectory), | 33 FilePath(FilePath::kCurrentDirectory), |
34 FilePath(FILE_PATH_LITERAL("title2.html"))); | 34 FilePath(FILE_PATH_LITERAL("title2.html"))); |
35 } | 35 } |
36 | 36 |
37 protected: | 37 protected: |
38 // Wrapper for Browser::AddTabWithURL | 38 // Wrapper for Browser::AddTabWithURL |
39 void AddTabWithURL(Browser* browser, const GURL& url) { | 39 void AddTabWithURL(Browser* browser, const GURL& url) { |
40 ui_test_utils::WindowedNotificationObserver observer( | 40 ui_test_utils::WindowedNotificationObserver observer( |
41 content::NOTIFICATION_LOAD_STOP, NotificationService::AllSources()); | 41 content::NOTIFICATION_LOAD_STOP, NotificationService::AllSources()); |
42 AddTabAtIndexToBrowser(browser, 0, url, PageTransition::TYPED); | 42 AddTabAtIndexToBrowser(browser, 0, url, content::PAGE_TRANSITION_TYPED); |
43 observer.Wait(); | 43 observer.Wait(); |
44 } | 44 } |
45 | 45 |
46 // Wrapper for TabCloseableStateWatcher::CanCloseTab | 46 // Wrapper for TabCloseableStateWatcher::CanCloseTab |
47 bool CanCloseTab(const Browser* browser) { | 47 bool CanCloseTab(const Browser* browser) { |
48 return browser->tabstrip_model()->delegate()->CanCloseTab(); | 48 return browser->tabstrip_model()->delegate()->CanCloseTab(); |
49 } | 49 } |
50 | 50 |
51 // Create popup browser. | 51 // Create popup browser. |
52 Browser* CreatePopupBrowser() { | 52 Browser* CreatePopupBrowser() { |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 AppModalDialog* confirm = ui_test_utils::WaitForAppModalDialog(); | 313 AppModalDialog* confirm = ui_test_utils::WaitForAppModalDialog(); |
314 confirm->native_dialog()->AcceptAppModalDialog(); | 314 confirm->native_dialog()->AcceptAppModalDialog(); |
315 NewTabObserver new_tab_observer(browser()); | 315 NewTabObserver new_tab_observer(browser()); |
316 EXPECT_EQ(1u, BrowserList::size()); | 316 EXPECT_EQ(1u, BrowserList::size()); |
317 EXPECT_EQ(browser(), *(BrowserList::begin())); | 317 EXPECT_EQ(browser(), *(BrowserList::begin())); |
318 EXPECT_EQ(1, browser()->tab_count()); | 318 EXPECT_EQ(1, browser()->tab_count()); |
319 EXPECT_EQ(ntp_url_, browser()->GetSelectedTabContents()->GetURL()); | 319 EXPECT_EQ(ntp_url_, browser()->GetSelectedTabContents()->GetURL()); |
320 } | 320 } |
321 | 321 |
322 } // namespace chromeos | 322 } // namespace chromeos |
OLD | NEW |