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

Unified Diff: chrome/renderer/extensions/extension_api_client_unittest.cc

Issue 173034: Validation of extension api callback and event parameters in DEBUG (Closed)
Patch Set: build docs Created 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/renderer/extensions/extension_api_client_unittest.cc
diff --git a/chrome/renderer/extensions/extension_api_client_unittest.cc b/chrome/renderer/extensions/extension_api_client_unittest.cc
index 49136c5131ae6757dfea84a5cdab17f6ff972d54..d5f73bb5796bea3c2a0893a038bca6f3750eab9d 100644
--- a/chrome/renderer/extensions/extension_api_client_unittest.cc
+++ b/chrome/renderer/extensions/extension_api_client_unittest.cc
@@ -71,7 +71,9 @@ TEST_F(ExtensionAPIClientTest, CallbackDispatching) {
"}"
"function callback(result) {"
" assert(typeof result == 'object', 'result not object');"
- " assert(JSON.stringify(result) == '{\"foo\":\"bar\"}', "
+ " assert(JSON.stringify(result) == '{\"id\":1,\"index\":1,\"windowId\":1,"
+ "\"selected\":true,"
+ "\"url\":\"http://www.google.com/\"}',"
" 'incorrect result');"
" console.log('pass')"
"}"
@@ -92,7 +94,8 @@ TEST_F(ExtensionAPIClientTest, CallbackDispatching) {
// Now send the callback a response
ExtensionProcessBindings::HandleResponse(
- callback_id, true, "{\"foo\":\"bar\"}", "");
+ callback_id, true, "{\"id\":1,\"index\":1,\"windowId\":1,\"selected\":true,"
+ "\"url\":\"http://www.google.com/\"}", "");
// And verify that it worked
ASSERT_EQ("pass", GetConsoleMessage());
« no previous file with comments | « chrome/renderer/extensions/event_bindings.cc ('k') | chrome/renderer/extensions/extension_process_bindings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698