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

Side by Side Diff: content/public/test/web_contents_tester.cc

Issue 11346016: Move remaining content test code into the content namespace. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 1 month 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
« no previous file with comments | « content/public/test/test_renderer_host.cc ('k') | content/test/content_browser_test.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "content/public/test/web_contents_tester.h" 5 #include "content/public/test/web_contents_tester.h"
6 6
7 #include "content/browser/web_contents/test_web_contents.h" 7 #include "content/browser/web_contents/test_web_contents.h"
8 8
9 namespace content { 9 namespace content {
10 10
11 namespace { 11 namespace {
12 12
13 // The two subclasses here are instantiated via the deprecated 13 // The two subclasses here are instantiated via the deprecated
14 // CreateWebContentsFor... factories below. 14 // CreateWebContentsFor... factories below.
15 15
16 class TestWebContentsCountFocus : public TestWebContents { 16 class TestWebContentsCountFocus : public TestWebContents {
17 public: 17 public:
18 explicit TestWebContentsCountFocus(content::BrowserContext* browser_context) 18 explicit TestWebContentsCountFocus(BrowserContext* browser_context)
19 : TestWebContents(browser_context), focus_called_(0) { 19 : TestWebContents(browser_context), focus_called_(0) {
20 } 20 }
21 21
22 virtual int GetNumberOfFocusCalls() OVERRIDE { 22 virtual int GetNumberOfFocusCalls() OVERRIDE {
23 return focus_called_; 23 return focus_called_;
24 } 24 }
25 25
26 virtual void Focus() OVERRIDE { 26 virtual void Focus() OVERRIDE {
27 focus_called_++; 27 focus_called_++;
28 } 28 }
29 29
30 private: 30 private:
31 int focus_called_; 31 int focus_called_;
32 }; 32 };
33 33
34 class TestWebContentsCountSetFocusToLocationBar : public TestWebContents { 34 class TestWebContentsCountSetFocusToLocationBar : public TestWebContents {
35 public: 35 public:
36 explicit TestWebContentsCountSetFocusToLocationBar( 36 explicit TestWebContentsCountSetFocusToLocationBar(
37 content::BrowserContext* browser_context) 37 BrowserContext* browser_context)
38 : TestWebContents(browser_context), focus_called_(0) { 38 : TestWebContents(browser_context), focus_called_(0) {
39 } 39 }
40 40
41 virtual void SetFocusToLocationBar(bool select_all) { ++focus_called_; } 41 virtual void SetFocusToLocationBar(bool select_all) { ++focus_called_; }
42 virtual int GetNumberOfFocusCalls() OVERRIDE { 42 virtual int GetNumberOfFocusCalls() OVERRIDE {
43 return focus_called_; 43 return focus_called_;
44 } 44 }
45 45
46 private: 46 private:
47 int focus_called_; 47 int focus_called_;
(...skipping 27 matching lines...) Expand all
75 WebContents* WebContentsTester::CreateTestWebContentsCountFocus( 75 WebContents* WebContentsTester::CreateTestWebContentsCountFocus(
76 BrowserContext* browser_context, 76 BrowserContext* browser_context,
77 SiteInstance* instance) { 77 SiteInstance* instance) {
78 TestWebContentsCountFocus* web_contents = 78 TestWebContentsCountFocus* web_contents =
79 new TestWebContentsCountFocus(browser_context); 79 new TestWebContentsCountFocus(browser_context);
80 web_contents->Init(browser_context, instance, MSG_ROUTING_NONE, NULL); 80 web_contents->Init(browser_context, instance, MSG_ROUTING_NONE, NULL);
81 return web_contents; 81 return web_contents;
82 } 82 }
83 83
84 } // namespace content 84 } // namespace content
OLDNEW
« no previous file with comments | « content/public/test/test_renderer_host.cc ('k') | content/test/content_browser_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698