| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/render_view_test.h" | 5 #include "chrome/test/render_view_test.h" |
| 6 | 6 |
| 7 #include "chrome/browser/extensions/extension_function_dispatcher.h" | 7 #include "chrome/browser/extensions/extension_function_dispatcher.h" |
| 8 #include "chrome/common/extensions/extension.h" | 8 #include "chrome/common/extensions/extension.h" |
| 9 #include "chrome/common/native_web_keyboard_event.h" | 9 #include "chrome/common/native_web_keyboard_event.h" |
| 10 #include "chrome/common/render_messages.h" | 10 #include "chrome/common/render_messages.h" |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 std::vector<std::string> permissions( | 98 std::vector<std::string> permissions( |
| 99 Extension::kPermissionNames, | 99 Extension::kPermissionNames, |
| 100 Extension::kPermissionNames + Extension::kNumPermissions); | 100 Extension::kPermissionNames + Extension::kNumPermissions); |
| 101 ExtensionProcessBindings::SetAPIPermissions("", permissions); | 101 ExtensionProcessBindings::SetAPIPermissions("", permissions); |
| 102 | 102 |
| 103 mock_process_.reset(new MockRenderProcess); | 103 mock_process_.reset(new MockRenderProcess); |
| 104 | 104 |
| 105 render_thread_.set_routing_id(kRouteId); | 105 render_thread_.set_routing_id(kRouteId); |
| 106 | 106 |
| 107 // This needs to pass the mock render thread to the view. | 107 // This needs to pass the mock render thread to the view. |
| 108 view_ = RenderView::Create(&render_thread_, 0, kOpenerId, | 108 view_ = RenderView::Create(&render_thread_, |
| 109 RendererPreferences(), WebPreferences(), | 109 0, |
| 110 new SharedRenderViewCounter(0), kRouteId, | 110 kOpenerId, |
| 111 kInvalidSessionStorageNamespaceId); | 111 RendererPreferences(), |
| 112 WebPreferences(), |
| 113 new SharedRenderViewCounter(0), |
| 114 kRouteId, |
| 115 kInvalidSessionStorageNamespaceId, |
| 116 string16()); |
| 112 | 117 |
| 113 // Attach a pseudo keyboard device to this object. | 118 // Attach a pseudo keyboard device to this object. |
| 114 mock_keyboard_.reset(new MockKeyboard()); | 119 mock_keyboard_.reset(new MockKeyboard()); |
| 115 } | 120 } |
| 116 | 121 |
| 117 void RenderViewTest::TearDown() { | 122 void RenderViewTest::TearDown() { |
| 118 // Try very hard to collect garbage before shutting down. | 123 // Try very hard to collect garbage before shutting down. |
| 119 GetMainFrame()->collectGarbage(); | 124 GetMainFrame()->collectGarbage(); |
| 120 GetMainFrame()->collectGarbage(); | 125 GetMainFrame()->collectGarbage(); |
| 121 | 126 |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 ViewHostMsg_DidPrintPage::Param post_did_print_page_param; | 256 ViewHostMsg_DidPrintPage::Param post_did_print_page_param; |
| 252 ViewHostMsg_DidPrintPage::Read(did_print_msg, &post_did_print_page_param); | 257 ViewHostMsg_DidPrintPage::Read(did_print_msg, &post_did_print_page_param); |
| 253 EXPECT_EQ(0, post_did_print_page_param.a.page_number); | 258 EXPECT_EQ(0, post_did_print_page_param.a.page_number); |
| 254 #elif defined(OS_LINUX) | 259 #elif defined(OS_LINUX) |
| 255 const IPC::Message* did_print_msg = | 260 const IPC::Message* did_print_msg = |
| 256 render_thread_.sink().GetUniqueMessageMatching( | 261 render_thread_.sink().GetUniqueMessageMatching( |
| 257 ViewHostMsg_TempFileForPrintingWritten::ID); | 262 ViewHostMsg_TempFileForPrintingWritten::ID); |
| 258 ASSERT_TRUE(did_print_msg); | 263 ASSERT_TRUE(did_print_msg); |
| 259 #endif | 264 #endif |
| 260 } | 265 } |
| OLD | NEW |