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

Side by Side Diff: content/public/test/mock_render_process_host.h

Issue 11308024: Fixing guest processes to use the proper storage partition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add comment to test. 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
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 #ifndef CONTENT_PUBLIC_TEST_MOCK_RENDER_PROCESS_HOST_H_ 5 #ifndef CONTENT_PUBLIC_TEST_MOCK_RENDER_PROCESS_HOST_H_
6 #define CONTENT_PUBLIC_TEST_MOCK_RENDER_PROCESS_HOST_H_ 6 #define CONTENT_PUBLIC_TEST_MOCK_RENDER_PROCESS_HOST_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/memory/scoped_vector.h" 9 #include "base/memory/scoped_vector.h"
10 #include "content/public/browser/render_process_host.h" 10 #include "content/public/browser/render_process_host.h"
11 #include "content/public/browser/render_process_host_factory.h" 11 #include "content/public/browser/render_process_host_factory.h"
12 #include "ipc/ipc_test_sink.h" 12 #include "ipc/ipc_test_sink.h"
13 13
14 class TransportDIB; 14 class TransportDIB;
15 class StoragePartition;
15 16
16 namespace content { 17 namespace content {
17 18
18 class MockRenderProcessHostFactory; 19 class MockRenderProcessHostFactory;
19 20
20 // A mock render process host that has no corresponding renderer process. All 21 // A mock render process host that has no corresponding renderer process. All
21 // IPC messages are sent into the message sink for inspection by tests. 22 // IPC messages are sent into the message sink for inspection by tests.
22 class MockRenderProcessHost : public RenderProcessHost { 23 class MockRenderProcessHost : public RenderProcessHost {
23 public: 24 public:
24 explicit MockRenderProcessHost(BrowserContext* browser_context); 25 explicit MockRenderProcessHost(BrowserContext* browser_context);
(...skipping 14 matching lines...) Expand all
39 virtual void SimulateSwapOutACK( 40 virtual void SimulateSwapOutACK(
40 const ViewMsg_SwapOut_Params& params) OVERRIDE; 41 const ViewMsg_SwapOut_Params& params) OVERRIDE;
41 virtual bool WaitForBackingStoreMsg(int render_widget_id, 42 virtual bool WaitForBackingStoreMsg(int render_widget_id,
42 const base::TimeDelta& max_delay, 43 const base::TimeDelta& max_delay,
43 IPC::Message* msg) OVERRIDE; 44 IPC::Message* msg) OVERRIDE;
44 virtual void ReceivedBadMessage() OVERRIDE; 45 virtual void ReceivedBadMessage() OVERRIDE;
45 virtual void WidgetRestored() OVERRIDE; 46 virtual void WidgetRestored() OVERRIDE;
46 virtual void WidgetHidden() OVERRIDE; 47 virtual void WidgetHidden() OVERRIDE;
47 virtual int VisibleWidgetCount() const OVERRIDE; 48 virtual int VisibleWidgetCount() const OVERRIDE;
48 virtual bool IsGuest() const OVERRIDE; 49 virtual bool IsGuest() const OVERRIDE;
50 virtual StoragePartition* GetStoragePartition() const OVERRIDE;
49 virtual void AddWord(const string16& word); 51 virtual void AddWord(const string16& word);
50 virtual bool FastShutdownIfPossible() OVERRIDE; 52 virtual bool FastShutdownIfPossible() OVERRIDE;
51 virtual bool FastShutdownStarted() const OVERRIDE; 53 virtual bool FastShutdownStarted() const OVERRIDE;
52 virtual void DumpHandles() OVERRIDE; 54 virtual void DumpHandles() OVERRIDE;
53 virtual base::ProcessHandle GetHandle() OVERRIDE; 55 virtual base::ProcessHandle GetHandle() OVERRIDE;
54 virtual TransportDIB* GetTransportDIB(TransportDIB::Id dib_id) OVERRIDE; 56 virtual TransportDIB* GetTransportDIB(TransportDIB::Id dib_id) OVERRIDE;
55 virtual int GetID() const OVERRIDE; 57 virtual int GetID() const OVERRIDE;
56 virtual bool HasConnection() const OVERRIDE; 58 virtual bool HasConnection() const OVERRIDE;
57 virtual void SetIgnoreInputEvents(bool ignore_input_events) OVERRIDE; 59 virtual void SetIgnoreInputEvents(bool ignore_input_events) OVERRIDE;
58 virtual bool IgnoreInputEvents() const OVERRIDE; 60 virtual bool IgnoreInputEvents() const OVERRIDE;
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 // for deleting all MockRenderProcessHosts that have not deleted by a test in 123 // for deleting all MockRenderProcessHosts that have not deleted by a test in
122 // the destructor and prevent them from being leaked. 124 // the destructor and prevent them from being leaked.
123 mutable ScopedVector<MockRenderProcessHost> processes_; 125 mutable ScopedVector<MockRenderProcessHost> processes_;
124 126
125 DISALLOW_COPY_AND_ASSIGN(MockRenderProcessHostFactory); 127 DISALLOW_COPY_AND_ASSIGN(MockRenderProcessHostFactory);
126 }; 128 };
127 129
128 } // namespace content 130 } // namespace content
129 131
130 #endif // CONTENT_PUBLIC_TEST_MOCK_RENDER_PROCESS_HOST_H_ 132 #endif // CONTENT_PUBLIC_TEST_MOCK_RENDER_PROCESS_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698