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

Side by Side Diff: ui/views/controls/webview/webview_interactive_uitest.cc

Issue 1159033008: Refactor ViewsDelegate singleton (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "ui/views/controls/webview/webview.h" 5 #include "ui/views/controls/webview/webview.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "content/public/browser/web_contents.h" 9 #include "content/public/browser/web_contents.h"
10 #include "content/public/test/test_browser_context.h" 10 #include "content/public/test/test_browser_context.h"
(...skipping 26 matching lines...) Expand all
37 }; 37 };
38 38
39 class WebViewInteractiveUiTest : public views::test::WidgetTest { 39 class WebViewInteractiveUiTest : public views::test::WidgetTest {
40 public: 40 public:
41 WebViewInteractiveUiTest() 41 WebViewInteractiveUiTest()
42 : ui_thread_(content::BrowserThread::UI, base::MessageLoop::current()) {} 42 : ui_thread_(content::BrowserThread::UI, base::MessageLoop::current()) {}
43 43
44 void SetUp() override { 44 void SetUp() override {
45 gfx::GLSurface::InitializeOneOffForTests(); 45 gfx::GLSurface::InitializeOneOffForTests();
46 // The ViewsDelegate is deleted when the ViewsTestBase class is torn down. 46 // The ViewsDelegate is deleted when the ViewsTestBase class is torn down.
47 WidgetTest::set_views_delegate(new WebViewTestViewsDelegate); 47 scoped_ptr<views::TestViewsDelegate> views_delegate(
48 new WebViewTestViewsDelegate);
49 set_views_delegate(views_delegate.Pass());
48 WidgetTest::SetUp(); 50 WidgetTest::SetUp();
49 } 51 }
50 52
51 protected: 53 protected:
52 content::BrowserContext* browser_context() { return &browser_context_; } 54 content::BrowserContext* browser_context() { return &browser_context_; }
53 55
54 private: 56 private:
55 content::TestBrowserContext browser_context_; 57 content::TestBrowserContext browser_context_;
56 views::WebViewTestHelper webview_test_helper_; 58 views::WebViewTestHelper webview_test_helper_;
57 content::TestBrowserThread ui_thread_; 59 content::TestBrowserThread ui_thread_;
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 ui::TextInputClient* client2 = webview->GetTextInputClient(); 110 ui::TextInputClient* client2 = webview->GetTextInputClient();
109 EXPECT_NE(nullptr, client2); 111 EXPECT_NE(nullptr, client2);
110 EXPECT_EQ(text_input_focus_manager->GetFocusedTextInputClient(), client2); 112 EXPECT_EQ(text_input_focus_manager->GetFocusedTextInputClient(), client2);
111 EXPECT_NE(client1, client2); 113 EXPECT_NE(client1, client2);
112 114
113 widget->Close(); 115 widget->Close();
114 RunPendingMessages(); 116 RunPendingMessages();
115 } 117 }
116 118
117 } // namespace 119 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698