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

Unified Diff: chrome/browser/ui/webui/html_dialog_controller_browsertest.cc

Issue 10214001: WebDialogs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 8 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/webui/html_dialog_controller_browsertest.cc
===================================================================
--- chrome/browser/ui/webui/html_dialog_controller_browsertest.cc (revision 133969)
+++ chrome/browser/ui/webui/html_dialog_controller_browsertest.cc (working copy)
@@ -1,64 +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 "base/memory/scoped_ptr.h"
-#include "chrome/browser/ui/browser.h"
-#include "chrome/browser/ui/webui/test_html_dialog_ui_delegate.h"
-#include "chrome/common/url_constants.h"
-#include "chrome/test/base/in_process_browser_test.h"
-#include "chrome/test/base/ui_test_utils.h"
-#include "testing/gmock/include/gmock/gmock.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace {
-
-class TestDialogClosedDelegate : public test::TestHtmlDialogUIDelegate {
- public:
- TestDialogClosedDelegate()
- : test::TestHtmlDialogUIDelegate(GURL(chrome::kChromeUIChromeURLsURL)),
- dialog_closed_(false) {
- }
-
- // Overridden from HtmlDialogUIDelegate:
- virtual ui::ModalType GetDialogModalType() const OVERRIDE {
- return ui::MODAL_TYPE_NONE;
- }
-
- // Overridden from HtmlDialogUIDelegate:
- virtual void OnDialogClosed(const std::string& json_retval) OVERRIDE {
- dialog_closed_ = true;
- }
-
- bool dialog_closed() {
- return dialog_closed_;
- }
-
- private:
- bool dialog_closed_;
-};
-
-} // namespace
-
-class HtmlDialogControllerBrowserTest : public InProcessBrowserTest {
- public:
- HtmlDialogControllerBrowserTest() {}
-};
-
-// Tests that an HtmlDialog can be shown for an incognito browser and that when
-// that browser is closed the dialog created by that browser is closed.
-IN_PROC_BROWSER_TEST_F(HtmlDialogControllerBrowserTest, IncognitoBrowser) {
- Browser* browser = CreateIncognitoBrowser();
- scoped_ptr<TestDialogClosedDelegate> delegate(new TestDialogClosedDelegate());
-
- // Create the dialog and make sure the initial "closed" state is what we
- // expect.
- browser->BrowserShowHtmlDialog(delegate.get(), NULL, STYLE_GENERIC);
- ui_test_utils::RunAllPendingInMessageLoop();
- ASSERT_FALSE(delegate->dialog_closed());
-
- // Closing the browser should close the dialogs associated with that browser.
- browser->CloseWindow();
- ui_test_utils::RunAllPendingInMessageLoop();
- ASSERT_TRUE(delegate->dialog_closed());
-}
« no previous file with comments | « chrome/browser/ui/webui/html_dialog_controller.cc ('k') | chrome/browser/ui/webui/html_dialog_tab_contents_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698