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

Unified Diff: chrome/browser/ui/constrained_window_tab_helper_unittest.cc

Issue 11633052: Rename platform-independent ConstrainedWindow types to WebContentsModalDialog types (part 2) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use gtk_widget_get_toplevel for GetNativeWindow Created 7 years, 12 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
Index: chrome/browser/ui/constrained_window_tab_helper_unittest.cc
diff --git a/chrome/browser/ui/constrained_window_tab_helper_unittest.cc b/chrome/browser/ui/constrained_window_tab_helper_unittest.cc
deleted file mode 100644
index 2ff348b014c2524afe1452ce8a0652f019c60f57..0000000000000000000000000000000000000000
--- a/chrome/browser/ui/constrained_window_tab_helper_unittest.cc
+++ /dev/null
@@ -1,63 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/ui/constrained_window.h"
-#include "chrome/browser/ui/constrained_window_tab_helper.h"
-#include "chrome/test/base/chrome_render_view_host_test_harness.h"
-#include "content/public/test/test_browser_thread.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-using content::BrowserThread;
-
-class ConstrainedWindowTabHelperTest : public ChromeRenderViewHostTestHarness {
- public:
- ConstrainedWindowTabHelperTest()
- : ChromeRenderViewHostTestHarness(),
- ui_thread_(BrowserThread::UI, &message_loop_) {
- }
-
- virtual void SetUp() {
- ChromeRenderViewHostTestHarness::SetUp();
- ConstrainedWindowTabHelper::CreateForWebContents(web_contents());
- }
-
- private:
- content::TestBrowserThread ui_thread_;
-};
-
-class WebContentsModalDialogCloseTest : public ConstrainedWindow {
- public:
- explicit WebContentsModalDialogCloseTest(content::WebContents* web_contents)
- : web_contents_(web_contents) {
- }
-
- virtual void ShowWebContentsModalDialog() {}
- virtual void FocusWebContentsModalDialog() {}
- virtual ~WebContentsModalDialogCloseTest() {}
-
- virtual void CloseWebContentsModalDialog() {
- ConstrainedWindowTabHelper* constrained_window_tab_helper =
- ConstrainedWindowTabHelper::FromWebContents(web_contents_);
- constrained_window_tab_helper->WillClose(this);
- close_count++;
- }
-
- int close_count;
- content::WebContents* web_contents_;
-};
-
-TEST_F(ConstrainedWindowTabHelperTest, ConstrainedWindows) {
- WebContentsModalDialogCloseTest window(web_contents());
- window.close_count = 0;
- ConstrainedWindowTabHelper* constrained_window_tab_helper =
- ConstrainedWindowTabHelper::FromWebContents(web_contents());
-
- const int kWindowCount = 4;
- for (int i = 0; i < kWindowCount; i++)
- constrained_window_tab_helper->AddDialog(&window);
- EXPECT_EQ(window.close_count, 0);
-
- constrained_window_tab_helper->CloseAllDialogs();
- EXPECT_EQ(window.close_count, kWindowCount);
-}
« no previous file with comments | « chrome/browser/ui/constrained_window_tab_helper_delegate.cc ('k') | chrome/browser/ui/extensions/shell_window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698