Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3032)

Unified Diff: chrome/browser/ssl/ssl_browser_tests.cc

Issue 7880003: content: Move constrained window code from TabContents to TabContentsWrapper (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix mac compile (add forward declaration to file that didn't have it) Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/instant/instant_loader.cc ('k') | chrome/browser/tab_contents/web_contents_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ssl/ssl_browser_tests.cc
diff --git a/chrome/browser/ssl/ssl_browser_tests.cc b/chrome/browser/ssl/ssl_browser_tests.cc
index ab2fffbe75431aa4c13a08ec7d84a3f948a4dc0d..302d07839cf694ead55df20e5c05200cdc338a08 100644
--- a/chrome/browser/ssl/ssl_browser_tests.cc
+++ b/chrome/browser/ssl/ssl_browser_tests.cc
@@ -8,6 +8,7 @@
#include "chrome/browser/tabs/tab_strip_model.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_navigator.h"
+#include "chrome/browser/ui/constrained_window_tab_helper.h"
#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/chrome_switches.h"
@@ -125,6 +126,12 @@ class SSLUITest : public InProcessBrowserTest {
observer.Wait();
}
+ int GetConstrainedWindowCount() const {
+ return static_cast<int>(
+ browser()->GetSelectedTabContentsWrapper()->
+ constrained_window_tab_helper()->constrained_window_count());
+ }
+
static bool GetFilePathWithHostAndPortReplacement(
const std::string& original_file_path,
const net::HostPortPair& host_port_pair,
@@ -586,7 +593,7 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, FLAKY_TestUnsafeContents) {
// opened (the iframe content opens one).
// Note: because of bug 1115868, no constrained window is opened right now.
// Once the bug is fixed, this will do the real check.
- EXPECT_EQ(0, static_cast<int>(tab->constrained_window_count()));
+ EXPECT_EQ(0, GetConstrainedWindowCount());
int img_width;
EXPECT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractInt(
@@ -861,13 +868,13 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, DISABLED_TestCloseTabWithUnsafePopup) {
// It is probably overkill to add a notification for a popup-opening, let's
// just poll.
for (int i = 0; i < 10; i++) {
- if (static_cast<int>(tab1->constrained_window_count()) > 0)
+ if (GetConstrainedWindowCount() > 0)
break;
MessageLoop::current()->PostDelayedTask(FROM_HERE,
new MessageLoop::QuitTask(), 1000);
ui_test_utils::RunMessageLoop();
}
- ASSERT_EQ(1, static_cast<int>(tab1->constrained_window_count()));
+ ASSERT_EQ(1, GetConstrainedWindowCount());
// Let's add another tab to make sure the browser does not exit when we close
// the first tab.
« no previous file with comments | « chrome/browser/instant/instant_loader.cc ('k') | chrome/browser/tab_contents/web_contents_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698