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

Unified Diff: ceee/ie/plugin/scripting/content_script_manager_unittest.cc

Issue 4997002: IE CEEE: Explicitly assign window properties/methods into the script host glo... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 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 side-by-side diff with in-line comments
Download patch
Index: ceee/ie/plugin/scripting/content_script_manager_unittest.cc
===================================================================
--- ceee/ie/plugin/scripting/content_script_manager_unittest.cc (revision 66115)
+++ ceee/ie/plugin/scripting/content_script_manager_unittest.cc (working copy)
@@ -223,36 +223,37 @@
// Set up to expect scripting initialization.
void ExpectScriptInitialization() {
- EXPECT_CALL(*script_host_,
- RegisterScriptObject(StrEq(L"window"), _, true))
- .WillOnce(Return(S_OK));
+ EXPECT_CALL(*frame_host_, GetExtensionId(_)).WillOnce(DoAll(
+ SetArgumentPointee<0>(std::wstring(kExtensionId)),
+ Return(S_OK)));
EXPECT_CALL(*script_host_,
RunScript(testing::StartsWith(L"ceee-content://"), _))
- .Times(5)
- .WillRepeatedly(Return(S_OK));
+ .Times(5).WillRepeatedly(Return(S_OK));
// Return the mock function for start/end init.
EXPECT_CALL(*script_host_, RunExpression(StrEq(L"ceee.startInit_"), _))
- .WillOnce(
- DoAll(
- CopyVariantToArgument<1>(CComVariant(function_keeper_)),
- Return(S_OK)));
+ .WillOnce(DoAll(
+ CopyVariantToArgument<1>(CComVariant(function_keeper_)),
+ Return(S_OK)));
EXPECT_CALL(*script_host_, RunExpression(StrEq(L"ceee.endInit_"), _))
- .WillOnce(
- DoAll(
- CopyVariantToArgument<1>(CComVariant(function_keeper_)),
- Return(S_OK)));
+ .WillOnce(DoAll(
+ CopyVariantToArgument<1>(CComVariant(function_keeper_)),
+ Return(S_OK)));
- EXPECT_CALL(*frame_host_, GetExtensionId(_)).WillOnce(DoAll(
- SetArgumentPointee<0>(std::wstring(kExtensionId)),
- Return(S_OK)));
+ // Register the window object and initialize its globals.
+ EXPECT_CALL(*script_host_,
+ RegisterScriptObject(StrEq(L"window"), _, false))
+ .WillOnce(Return(S_OK));
+ EXPECT_CALL(*script_host_, RunExpression(StrEq(L"ceee.initGlobals_"), _))
+ .WillOnce(DoAll(
+ CopyVariantToArgument<1>(CComVariant(function_keeper_)),
+ Return(S_OK)));
- // And expect two invocations.
+ // And expect three invocations.
// TODO(siggi@chromium.org): be more specific?
EXPECT_CALL(*function_, Invoke(_, _, _, _, _, _, _, _))
- .Times(2)
- .WillRepeatedly(Return(S_OK));
+ .Times(3).WillRepeatedly(Return(S_OK));
}
void ExpectCreateScriptHost(TestingContentScriptManager* manager) {

Powered by Google App Engine
This is Rietveld 408576698