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

Side by Side Diff: chrome/browser/ui/webui/web_dialog_controller_browsertest.cc

Issue 10448066: Move the web dialogs code to src/ui/web_dialogs from src/chrome (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/memory/scoped_ptr.h" 5 #include "base/memory/scoped_ptr.h"
6 #include "chrome/browser/ui/browser.h" 6 #include "chrome/browser/ui/browser.h"
7 #include "chrome/browser/ui/webui/test_web_dialog_delegate.h" 7 #include "chrome/browser/ui/webui/test_web_dialog_delegate.h"
8 #include "chrome/common/url_constants.h" 8 #include "chrome/common/url_constants.h"
9 #include "chrome/test/base/in_process_browser_test.h" 9 #include "chrome/test/base/in_process_browser_test.h"
10 #include "chrome/test/base/ui_test_utils.h" 10 #include "chrome/test/base/ui_test_utils.h"
11 #include "testing/gmock/include/gmock/gmock.h" 11 #include "testing/gmock/include/gmock/gmock.h"
12 #include "testing/gtest/include/gtest/gtest.h" 12 #include "testing/gtest/include/gtest/gtest.h"
13 13
14 namespace { 14 namespace {
15 15
16 class TestDialogClosedDelegate : public test::TestWebDialogDelegate { 16 class TestDialogClosedDelegate : public test::TestWebDialogDelegate {
17 public: 17 public:
18 TestDialogClosedDelegate() 18 TestDialogClosedDelegate()
19 : test::TestWebDialogDelegate( 19 : test::TestWebDialogDelegate(
20 GURL(chrome::kChromeUIChromeURLsURL)), 20 GURL(chrome::kChromeUIChromeURLsURL)),
21 dialog_closed_(false) { 21 dialog_closed_(false) {
22 } 22 }
23 23
24 bool dialog_closed() const { return dialog_closed_; } 24 bool dialog_closed() const { return dialog_closed_; }
25 25
26 // Overridden from WebDialogDelegate: 26 // Overridden from ui::WebDialogDelegate:
27 virtual ui::ModalType GetDialogModalType() const OVERRIDE { 27 virtual ui::ModalType GetDialogModalType() const OVERRIDE {
28 return ui::MODAL_TYPE_NONE; 28 return ui::MODAL_TYPE_NONE;
29 } 29 }
30 virtual void OnDialogClosed(const std::string& json_retval) OVERRIDE { 30 virtual void OnDialogClosed(const std::string& json_retval) OVERRIDE {
31 dialog_closed_ = true; 31 dialog_closed_ = true;
32 } 32 }
33 33
34 private: 34 private:
35 bool dialog_closed_; 35 bool dialog_closed_;
36 36
(...skipping 17 matching lines...) Expand all
54 // expect. 54 // expect.
55 browser->BrowserShowWebDialog(delegate.get(), NULL); 55 browser->BrowserShowWebDialog(delegate.get(), NULL);
56 ui_test_utils::RunAllPendingInMessageLoop(); 56 ui_test_utils::RunAllPendingInMessageLoop();
57 ASSERT_FALSE(delegate->dialog_closed()); 57 ASSERT_FALSE(delegate->dialog_closed());
58 58
59 // Closing the browser should close the dialogs associated with that browser. 59 // Closing the browser should close the dialogs associated with that browser.
60 browser->CloseWindow(); 60 browser->CloseWindow();
61 ui_test_utils::RunAllPendingInMessageLoop(); 61 ui_test_utils::RunAllPendingInMessageLoop();
62 ASSERT_TRUE(delegate->dialog_closed()); 62 ASSERT_TRUE(delegate->dialog_closed());
63 } 63 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/web_dialog_controller.cc ('k') | chrome/browser/ui/webui/web_dialog_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698