OLD | NEW |
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/test/ppapi_unittest.h" | 5 #include "content/test/ppapi_unittest.h" |
6 | 6 |
7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
8 #include "content/renderer/pepper/gfx_conversion.h" | 8 #include "content/renderer/pepper/gfx_conversion.h" |
9 #include "content/renderer/pepper/host_globals.h" | 9 #include "content/renderer/pepper/host_globals.h" |
10 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" | 10 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 | 71 |
72 PpapiUnittest::~PpapiUnittest() { | 72 PpapiUnittest::~PpapiUnittest() { |
73 DCHECK(current_unittest == this); | 73 DCHECK(current_unittest == this); |
74 current_unittest = NULL; | 74 current_unittest = NULL; |
75 } | 75 } |
76 | 76 |
77 void PpapiUnittest::SetUp() { | 77 void PpapiUnittest::SetUp() { |
78 message_loop_.reset(new base::MessageLoop()); | 78 message_loop_.reset(new base::MessageLoop()); |
79 | 79 |
80 // Initialize the mock module. | 80 // Initialize the mock module. |
81 module_ = new PluginModule("Mock plugin", base::FilePath(), | 81 module_ = new PluginModule("Mock plugin", "1.0", base::FilePath(), |
82 ppapi::PpapiPermissions()); | 82 ppapi::PpapiPermissions()); |
83 ppapi::PpapiGlobals::Get()->ResetMainThreadMessageLoopForTesting(); | 83 ppapi::PpapiGlobals::Get()->ResetMainThreadMessageLoopForTesting(); |
84 PepperPluginInfo::EntryPoints entry_points; | 84 PepperPluginInfo::EntryPoints entry_points; |
85 entry_points.get_interface = &MockGetInterface; | 85 entry_points.get_interface = &MockGetInterface; |
86 entry_points.initialize_module = &MockInitializeModule; | 86 entry_points.initialize_module = &MockInitializeModule; |
87 ASSERT_TRUE(module_->InitAsInternalPlugin(entry_points)); | 87 ASSERT_TRUE(module_->InitAsInternalPlugin(entry_points)); |
88 | 88 |
89 // Initialize the mock instance. | 89 // Initialize the mock instance. |
90 instance_ = PepperPluginInstanceImpl::Create(NULL, module(), NULL, GURL()); | 90 instance_ = PepperPluginInstanceImpl::Create(NULL, module(), NULL, GURL()); |
91 } | 91 } |
(...skipping 17 matching lines...) Expand all Loading... |
109 DCHECK(module_->HasOneRef()); | 109 DCHECK(module_->HasOneRef()); |
110 module_ = NULL; | 110 module_ = NULL; |
111 } | 111 } |
112 | 112 |
113 void PpapiUnittest::SetViewSize(int width, int height) const { | 113 void PpapiUnittest::SetViewSize(int width, int height) const { |
114 instance_->view_data_.rect = PP_FromGfxRect(gfx::Rect(0, 0, width, height)); | 114 instance_->view_data_.rect = PP_FromGfxRect(gfx::Rect(0, 0, width, height)); |
115 instance_->view_data_.clip_rect = instance_->view_data_.rect; | 115 instance_->view_data_.clip_rect = instance_->view_data_.rect; |
116 } | 116 } |
117 | 117 |
118 } // namespace content | 118 } // namespace content |
OLD | NEW |