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/test/test_timeouts.h" | 5 #include "base/test/test_timeouts.h" |
6 #include "build/build_config.h" | 6 #include "build/build_config.h" |
7 #include "chrome/browser/ui/browser.h" | 7 #include "chrome/browser/ui/browser.h" |
8 #include "chrome/browser/ui/chrome_pages.h" | 8 #include "chrome/browser/ui/chrome_pages.h" |
9 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 9 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
10 #include "chrome/browser/ui/webui/md_bookmarks/md_bookmarks_ui.h" | 10 #include "chrome/browser/ui/webui/md_bookmarks/md_bookmarks_ui.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 navigation_observer.Wait(); | 38 navigation_observer.Wait(); |
39 } | 39 } |
40 | 40 |
41 void AssertIsBookmarksPage(content::WebContents* tab) { | 41 void AssertIsBookmarksPage(content::WebContents* tab) { |
42 GURL url; | 42 GURL url; |
43 std::string out; | 43 std::string out; |
44 | 44 |
45 if (MdBookmarksUI::IsEnabled()) { | 45 if (MdBookmarksUI::IsEnabled()) { |
46 ASSERT_TRUE(content::ExecuteScriptAndExtractString( | 46 ASSERT_TRUE(content::ExecuteScriptAndExtractString( |
47 tab, "domAutomationController.send(location.href)", &out)); | 47 tab, "domAutomationController.send(location.href)", &out)); |
48 ASSERT_EQ("chrome://bookmarks/?id=1", out); | 48 ASSERT_EQ("chrome://bookmarks/", out); |
49 return; | 49 return; |
50 } | 50 } |
51 | 51 |
52 ASSERT_TRUE(content::ExecuteScriptAndExtractString( | 52 ASSERT_TRUE(content::ExecuteScriptAndExtractString( |
53 tab, | 53 tab, |
54 "domAutomationController.send(location.protocol)", | 54 "domAutomationController.send(location.protocol)", |
55 &out)); | 55 &out)); |
56 ASSERT_EQ("chrome-extension:", out); | 56 ASSERT_EQ("chrome-extension:", out); |
57 ASSERT_TRUE(content::ExecuteScriptAndExtractString( | 57 ASSERT_TRUE(content::ExecuteScriptAndExtractString( |
58 tab, | 58 tab, |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 navigation_observer.Wait(); | 111 navigation_observer.Wait(); |
112 | 112 |
113 ASSERT_EQ(1, browser()->tab_strip_model()->count()); | 113 ASSERT_EQ(1, browser()->tab_strip_model()->count()); |
114 } | 114 } |
115 | 115 |
116 IN_PROC_BROWSER_TEST_F(BookmarksTest, BookmarksLoaded) { | 116 IN_PROC_BROWSER_TEST_F(BookmarksTest, BookmarksLoaded) { |
117 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUIBookmarksURL)); | 117 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUIBookmarksURL)); |
118 ASSERT_EQ(1, browser()->tab_strip_model()->count()); | 118 ASSERT_EQ(1, browser()->tab_strip_model()->count()); |
119 AssertIsBookmarksPage(browser()->tab_strip_model()->GetActiveWebContents()); | 119 AssertIsBookmarksPage(browser()->tab_strip_model()->GetActiveWebContents()); |
120 } | 120 } |
OLD | NEW |