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/bind.h" | 5 #include "base/bind.h" |
6 #include "base/strings/utf_string_conversions.h" | 6 #include "base/strings/utf_string_conversions.h" |
7 #include "base/timer/timer.h" | 7 #include "base/timer/timer.h" |
8 #include "chrome/app/chrome_command_ids.h" | 8 #include "chrome/app/chrome_command_ids.h" |
9 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 9 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 | 178 |
179 TestBookmarkTabHelperDelegate bookmark_delegate; | 179 TestBookmarkTabHelperDelegate bookmark_delegate; |
180 content::WebContents* web_contents = | 180 content::WebContents* web_contents = |
181 browser()->tab_strip_model()->GetActiveWebContents(); | 181 browser()->tab_strip_model()->GetActiveWebContents(); |
182 BookmarkTabHelper* tab_helper = | 182 BookmarkTabHelper* tab_helper = |
183 BookmarkTabHelper::FromWebContents(web_contents); | 183 BookmarkTabHelper::FromWebContents(web_contents); |
184 tab_helper->set_delegate(&bookmark_delegate); | 184 tab_helper->set_delegate(&bookmark_delegate); |
185 | 185 |
186 // Go to a bookmarked url. Bookmark star should show. | 186 // Go to a bookmarked url. Bookmark star should show. |
187 ui_test_utils::NavigateToURL(browser(), bookmark_url); | 187 ui_test_utils::NavigateToURL(browser(), bookmark_url); |
188 EXPECT_FALSE(web_contents->ShowingInterstitialPage()); | 188 content::WaitForInterstitialAttach(web_contents); |
| 189 EXPECT_TRUE(web_contents->ShowingInterstitialPage()); |
189 EXPECT_TRUE(bookmark_delegate.is_starred()); | 190 EXPECT_TRUE(bookmark_delegate.is_starred()); |
190 | 191 |
191 // Now go to a non-bookmarked url which triggers an SSL warning. Bookmark | 192 // Now go to a non-bookmarked url which triggers an SSL warning. Bookmark |
192 // star should disappear. | 193 // star should disappear. |
193 GURL error_url = https_server.GetURL("."); | 194 GURL error_url = https_server.GetURL("."); |
194 ui_test_utils::NavigateToURL(browser(), error_url); | 195 ui_test_utils::NavigateToURL(browser(), error_url); |
195 web_contents = browser()->tab_strip_model()->GetActiveWebContents(); | 196 web_contents = browser()->tab_strip_model()->GetActiveWebContents(); |
196 content::WaitForInterstitialAttach(web_contents); | 197 content::WaitForInterstitialAttach(web_contents); |
197 EXPECT_TRUE(web_contents->ShowingInterstitialPage()); | 198 EXPECT_TRUE(web_contents->ShowingInterstitialPage()); |
198 EXPECT_FALSE(bookmark_delegate.is_starred()); | 199 EXPECT_FALSE(bookmark_delegate.is_starred()); |
199 } | 200 } |
OLD | NEW |