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

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

Issue 10353007: Extract a minimal subset of WebDialogUI/WebDialogDelegate from src/chrome -> src/ui/web_dialogs Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 8 years, 7 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 "chrome/browser/ui/webui/web_dialog_web_contents_delegate.h" 5 #include "chrome/browser/ui/webui/chrome_web_dialog_web_contents_delegate.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 #include "chrome/browser/history/history_types.h" 11 #include "chrome/browser/history/history_types.h"
12 #include "chrome/browser/ui/browser.h" 12 #include "chrome/browser/ui/browser.h"
13 #include "chrome/browser/ui/browser_list.h" 13 #include "chrome/browser/ui/browser_list.h"
14 #include "chrome/common/url_constants.h" 14 #include "chrome/common/url_constants.h"
15 #include "chrome/test/base/browser_with_test_window_test.h" 15 #include "chrome/test/base/browser_with_test_window_test.h"
16 #include "chrome/test/base/test_browser_window.h" 16 #include "chrome/test/base/test_browser_window.h"
17 #include "chrome/test/base/testing_profile.h" 17 #include "chrome/test/base/testing_profile.h"
18 #include "content/public/browser/web_contents.h" 18 #include "content/public/browser/web_contents.h"
19 #include "content/test/web_contents_tester.h" 19 #include "content/test/web_contents_tester.h"
20 #include "googleurl/src/gurl.h" 20 #include "googleurl/src/gurl.h"
21 #include "testing/gmock/include/gmock/gmock.h" 21 #include "testing/gmock/include/gmock/gmock.h"
22 #include "testing/gtest/include/gtest/gtest.h" 22 #include "testing/gtest/include/gtest/gtest.h"
23 #include "ui/gfx/rect.h" 23 #include "ui/gfx/rect.h"
24 24
25 using content::OpenURLParams; 25 using content::OpenURLParams;
26 using content::Referrer; 26 using content::Referrer;
27 using content::WebContents; 27 using content::WebContents;
28 using content::WebContentsTester; 28 using content::WebContentsTester;
29 29
30 namespace { 30 namespace {
31 31
32 class TestWebContentsDelegate : public WebDialogWebContentsDelegate { 32 class TestWebContentsDelegate : public ChromeWebDialogWebContentsDelegate {
33 public: 33 public:
34 explicit TestWebContentsDelegate(Profile* profile) 34 explicit TestWebContentsDelegate(Profile* profile)
35 : WebDialogWebContentsDelegate(profile) { 35 : ChromeWebDialogWebContentsDelegate(profile) {
36 } 36 }
37 virtual ~TestWebContentsDelegate() { 37 virtual ~TestWebContentsDelegate() {
38 } 38 }
39 39
40 private: 40 private:
41 DISALLOW_COPY_AND_ASSIGN(TestWebContentsDelegate); 41 DISALLOW_COPY_AND_ASSIGN(TestWebContentsDelegate);
42 }; 42 };
43 43
44 class WebDialogWebContentsDelegateTest : public BrowserWithTestWindowTest { 44 class WebDialogWebContentsDelegateTest : public BrowserWithTestWindowTest {
45 public: 45 public:
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 test_web_contents_delegate_->OpenURLFromTab( 103 test_web_contents_delegate_->OpenURLFromTab(
104 NULL, OpenURLParams(GURL(chrome::kAboutBlankURL), Referrer(), 104 NULL, OpenURLParams(GURL(chrome::kAboutBlankURL), Referrer(),
105 NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_LINK, false)); 105 NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_LINK, false));
106 test_web_contents_delegate_->AddNewContents(NULL, NULL, NEW_FOREGROUND_TAB, 106 test_web_contents_delegate_->AddNewContents(NULL, NULL, NEW_FOREGROUND_TAB,
107 gfx::Rect(), false); 107 gfx::Rect(), false);
108 EXPECT_EQ(0, browser()->tab_count()); 108 EXPECT_EQ(0, browser()->tab_count());
109 EXPECT_EQ(1U, BrowserList::size()); 109 EXPECT_EQ(1U, BrowserList::size());
110 } 110 }
111 111
112 } // namespace 112 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698