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

Side by Side Diff: webkit/plugins/ppapi/ppapi_unittest.h

Issue 20165002: Move webkit/plugins/ppapi to content/renderer/pepper. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: more more clang fun Created 7 years, 4 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef WEBKIT_PLUGINS_PPAPI_PPAPI_UNITTEST_H_
6 #define WEBKIT_PLUGINS_PPAPI_PPAPI_UNITTEST_H_
7
8 #include "base/basictypes.h"
9 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "testing/gtest/include/gtest/gtest.h"
12 #include "webkit/plugins/ppapi/plugin_delegate.h"
13
14 namespace base {
15 class MessageLoop;
16 }
17
18 namespace webkit {
19 namespace ppapi {
20
21 class MockPluginDelegate;
22 class PluginInstanceImpl;
23 class PluginModule;
24
25 class PpapiUnittest : public testing::Test,
26 public webkit::ppapi::PluginDelegate::ModuleLifetime {
27 public:
28 PpapiUnittest();
29 virtual ~PpapiUnittest();
30
31 virtual void SetUp();
32 virtual void TearDown();
33
34 MockPluginDelegate* delegate() { return delegate_.get(); }
35 PluginModule* module() const { return module_.get(); }
36 PluginInstanceImpl* instance() const { return instance_.get(); }
37
38 // Provides access to the interfaces implemented by the test. The default one
39 // implements PPP_INSTANCE.
40 virtual const void* GetMockInterface(const char* interface_name) const;
41
42 // Deletes the instance and module to simulate module shutdown.
43 void ShutdownModule();
44
45 // Sets the view size of the plugin instance.
46 void SetViewSize(int width, int height) const;
47
48 protected:
49 virtual MockPluginDelegate* NewPluginDelegate();
50
51 private:
52 scoped_ptr<MockPluginDelegate> delegate_;
53
54 // Note: module must be declared first since we want it to get destroyed last.
55 scoped_refptr<PluginModule> module_;
56 scoped_refptr<PluginInstanceImpl> instance_;
57
58 scoped_ptr<base::MessageLoop> message_loop_;
59
60 // ModuleLifetime implementation.
61 virtual void PluginModuleDead(PluginModule* dead_module);
62
63 DISALLOW_COPY_AND_ASSIGN(PpapiUnittest);
64 };
65
66 } // namespace ppapi
67 } // namespace webkit
68
69 #endif // WEBKIT_PLUGINS_PPAPI_PPAPI_UNITTEST_H_
OLDNEW
« no previous file with comments | « webkit/plugins/ppapi/ppapi_plugin_instance_unittest.cc ('k') | webkit/plugins/ppapi/ppapi_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698