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

Side by Side Diff: chrome/test/base/chrome_render_view_test.cc

Issue 563313004: [Password Manager] Unfriend PasswordAutofillAgentTest from PasswordAutofillAgent (clean-up). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Incorporated review comments. Created 6 years, 3 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 (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/test/base/chrome_render_view_test.h" 5 #include "chrome/test/base/chrome_render_view_test.h"
6 6
7 #include "base/debug/leak_annotations.h" 7 #include "base/debug/leak_annotations.h"
8 #include "chrome/browser/chrome_content_browser_client.h" 8 #include "chrome/browser/chrome_content_browser_client.h"
9 #include "chrome/common/chrome_content_client.h" 9 #include "chrome/common/chrome_content_client.h"
10 #include "chrome/common/render_messages.h" 10 #include "chrome/common/render_messages.h"
(...skipping 28 matching lines...) Expand all
39 using autofill::PasswordGenerationAgent; 39 using autofill::PasswordGenerationAgent;
40 using blink::WebFrame; 40 using blink::WebFrame;
41 using blink::WebInputEvent; 41 using blink::WebInputEvent;
42 using blink::WebMouseEvent; 42 using blink::WebMouseEvent;
43 using blink::WebScriptController; 43 using blink::WebScriptController;
44 using blink::WebScriptSource; 44 using blink::WebScriptSource;
45 using blink::WebString; 45 using blink::WebString;
46 using blink::WebURLRequest; 46 using blink::WebURLRequest;
47 47
48 ChromeRenderViewTest::ChromeRenderViewTest() 48 ChromeRenderViewTest::ChromeRenderViewTest()
49 : password_autofill_(NULL), 49 : password_autofill_agent_(NULL),
50 password_generation_(NULL), 50 password_generation_(NULL),
51 autofill_agent_(NULL), 51 autofill_agent_(NULL),
52 chrome_render_thread_(NULL) { 52 chrome_render_thread_(NULL) {
53 } 53 }
54 54
55 ChromeRenderViewTest::~ChromeRenderViewTest() { 55 ChromeRenderViewTest::~ChromeRenderViewTest() {
56 } 56 }
57 57
58 void ChromeRenderViewTest::SetUp() { 58 void ChromeRenderViewTest::SetUp() {
59 ChromeUnitTestSuite::InitializeProviders(); 59 ChromeUnitTestSuite::InitializeProviders();
60 ChromeUnitTestSuite::InitializeResourceBundle(); 60 ChromeUnitTestSuite::InitializeResourceBundle();
61 61
62 chrome_render_thread_ = new ChromeMockRenderThread(); 62 chrome_render_thread_ = new ChromeMockRenderThread();
63 render_thread_.reset(chrome_render_thread_); 63 render_thread_.reset(chrome_render_thread_);
64 64
65 content::RenderViewTest::SetUp(); 65 content::RenderViewTest::SetUp();
66 66
67 // RenderView doesn't expose its Agent objects, because it has no need to 67 // RenderView doesn't expose its Agent objects, because it has no need to
68 // store them directly (they're stored as RenderViewObserver*). So just 68 // store them directly (they're stored as RenderViewObserver*). So just
69 // create another set. 69 // create another set.
70 password_autofill_ = new autofill::TestPasswordAutofillAgent(view_); 70 password_autofill_agent_ = new autofill::TestPasswordAutofillAgent(view_);
71 password_generation_ = new autofill::TestPasswordGenerationAgent(view_); 71 password_generation_ = new autofill::TestPasswordGenerationAgent(view_);
72 autofill_agent_ = 72 autofill_agent_ =
73 new AutofillAgent(view_, password_autofill_, password_generation_); 73 new AutofillAgent(view_, password_autofill_agent_, password_generation_);
74 } 74 }
75 75
76 void ChromeRenderViewTest::TearDown() { 76 void ChromeRenderViewTest::TearDown() {
77 #if defined(ENABLE_EXTENSIONS) 77 #if defined(ENABLE_EXTENSIONS)
78 ChromeContentRendererClient* client = 78 ChromeContentRendererClient* client =
79 static_cast<ChromeContentRendererClient*>(content_renderer_client_.get()); 79 static_cast<ChromeContentRendererClient*>(content_renderer_client_.get());
80 client->GetExtensionDispatcherForTest()->OnRenderProcessShutdown(); 80 client->GetExtensionDispatcherForTest()->OnRenderProcessShutdown();
81 #endif 81 #endif
82 82
83 #if defined(LEAK_SANITIZER) 83 #if defined(LEAK_SANITIZER)
(...skipping 20 matching lines...) Expand all
104 extension_dispatcher_delegate_.reset( 104 extension_dispatcher_delegate_.reset(
105 new ChromeExtensionsDispatcherDelegate()); 105 new ChromeExtensionsDispatcherDelegate());
106 client->SetExtensionDispatcherForTest( 106 client->SetExtensionDispatcherForTest(
107 new extensions::Dispatcher(extension_dispatcher_delegate_.get())); 107 new extensions::Dispatcher(extension_dispatcher_delegate_.get()));
108 #endif 108 #endif
109 #if defined(ENABLE_SPELLCHECK) 109 #if defined(ENABLE_SPELLCHECK)
110 client->SetSpellcheck(new SpellCheck()); 110 client->SetSpellcheck(new SpellCheck());
111 #endif 111 #endif
112 return client; 112 return client;
113 } 113 }
OLDNEW
« no previous file with comments | « chrome/test/base/chrome_render_view_test.h ('k') | components/autofill/content/renderer/autofill_agent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698