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 // Content script manager implementation unit tests. | 5 // Content script manager implementation unit tests. |
6 #include "ceee/ie/plugin/scripting/content_script_manager.h" | 6 #include "ceee/ie/plugin/scripting/content_script_manager.h" |
7 | 7 |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "ceee/common/initializing_coclass.h" | 10 #include "ceee/common/initializing_coclass.h" |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 .WillOnce(DoAll( | 236 .WillOnce(DoAll( |
237 CopyVariantToArgument<1>(CComVariant(function_keeper_)), | 237 CopyVariantToArgument<1>(CComVariant(function_keeper_)), |
238 Return(S_OK))); | 238 Return(S_OK))); |
239 EXPECT_CALL(*script_host_, RunExpression(StrEq(L"ceee.endInit_"), _)) | 239 EXPECT_CALL(*script_host_, RunExpression(StrEq(L"ceee.endInit_"), _)) |
240 .WillOnce(DoAll( | 240 .WillOnce(DoAll( |
241 CopyVariantToArgument<1>(CComVariant(function_keeper_)), | 241 CopyVariantToArgument<1>(CComVariant(function_keeper_)), |
242 Return(S_OK))); | 242 Return(S_OK))); |
243 | 243 |
244 // Register the window object and initialize its globals. | 244 // Register the window object and initialize its globals. |
245 EXPECT_CALL(*script_host_, | 245 EXPECT_CALL(*script_host_, |
246 RegisterScriptObject(StrEq(L"window"), _, false)) | 246 RegisterScriptObject(StrEq(L"unsafeWindow"), _, false)) |
247 .WillOnce(Return(S_OK)); | 247 .WillOnce(Return(S_OK)); |
248 EXPECT_CALL(*script_host_, RunExpression(StrEq(L"ceee.initGlobals_"), _)) | 248 EXPECT_CALL(*script_host_, RunExpression(StrEq(L"ceee.initGlobals_"), _)) |
249 .WillOnce(DoAll( | 249 .WillOnce(DoAll( |
250 CopyVariantToArgument<1>(CComVariant(function_keeper_)), | 250 CopyVariantToArgument<1>(CComVariant(function_keeper_)), |
251 Return(S_OK))); | 251 Return(S_OK))); |
252 | 252 |
253 // And expect three invocations. | 253 // And expect three invocations. |
254 // TODO(siggi@chromium.org): be more specific? | 254 // TODO(siggi@chromium.org): be more specific? |
255 EXPECT_CALL(*function_, Invoke(_, _, _, _, _, _, _, _)) | 255 EXPECT_CALL(*function_, Invoke(_, _, _, _, _, _, _, _)) |
256 .Times(3).WillRepeatedly(Return(S_OK)); | 256 .Times(3).WillRepeatedly(Return(S_OK)); |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 | 481 |
482 EXPECT_CALL(manager, | 482 EXPECT_CALL(manager, |
483 InjectStyleTag(document_, head_node.p, StrEq(kCssContent))) | 483 InjectStyleTag(document_, head_node.p, StrEq(kCssContent))) |
484 .WillOnce(Return(S_OK)); | 484 .WillOnce(Return(S_OK)); |
485 | 485 |
486 ASSERT_HRESULT_SUCCEEDED( | 486 ASSERT_HRESULT_SUCCEEDED( |
487 manager.ContentScriptManager::InsertCss(kCssContent, document_)); | 487 manager.ContentScriptManager::InsertCss(kCssContent, document_)); |
488 } | 488 } |
489 | 489 |
490 } // namespace | 490 } // namespace |
OLD | NEW |