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

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: Addressed review comments 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 25 matching lines...) Expand all
36 DISALLOW_COPY_AND_ASSIGN(WebViewTestViewsDelegate); 36 DISALLOW_COPY_AND_ASSIGN(WebViewTestViewsDelegate);
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 set_views_delegate(make_scoped_ptr(new WebViewTestViewsDelegate));
47 WidgetTest::set_views_delegate(new WebViewTestViewsDelegate);
48 WidgetTest::SetUp(); 47 WidgetTest::SetUp();
49 } 48 }
50 49
51 protected: 50 protected:
52 content::BrowserContext* browser_context() { return &browser_context_; } 51 content::BrowserContext* browser_context() { return &browser_context_; }
53 52
54 private: 53 private:
55 content::TestBrowserContext browser_context_; 54 content::TestBrowserContext browser_context_;
56 views::WebViewTestHelper webview_test_helper_; 55 views::WebViewTestHelper webview_test_helper_;
57 content::TestBrowserThread ui_thread_; 56 content::TestBrowserThread ui_thread_;
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 ui::TextInputClient* client2 = webview->GetTextInputClient(); 107 ui::TextInputClient* client2 = webview->GetTextInputClient();
109 EXPECT_NE(nullptr, client2); 108 EXPECT_NE(nullptr, client2);
110 EXPECT_EQ(text_input_focus_manager->GetFocusedTextInputClient(), client2); 109 EXPECT_EQ(text_input_focus_manager->GetFocusedTextInputClient(), client2);
111 EXPECT_NE(client1, client2); 110 EXPECT_NE(client1, client2);
112 111
113 widget->Close(); 112 widget->Close();
114 RunPendingMessages(); 113 RunPendingMessages();
115 } 114 }
116 115
117 } // namespace 116 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698