From 434c21e053a20e5d417125a62f6f9de31258a8ce Mon Sep 17 00:00:00 2001 From: "rafaelw@chromium.org" Date: Thu, 16 Jul 2009 22:20:00 +0000 Subject: First step in abstracting extension api to common/shared "IDL" files (jsonschema). In this step, All "normal" api calls and events (those that arrive or originate from the browser process) are routed through a single v8::Extension API Call ("StartRequest"). Additionally, internal string names for methods and events now match the js namespace (i.e. "RemoveTab" -> "tabs.remove"), in anticipation of having names be implicit from their api module & name in the api "IDL". TBR=aa,mpcomplete Review URL: http://codereview.chromium.org/149730 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20910 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/extensions/extension_uitest.cc | 38 +++++++++++++-------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'chrome/browser/extensions/extension_uitest.cc') diff --git a/chrome/browser/extensions/extension_uitest.cc b/chrome/browser/extensions/extension_uitest.cc index 6945446..89faa41 100644 --- a/chrome/browser/extensions/extension_uitest.cc +++ b/chrome/browser/extensions/extension_uitest.cc @@ -130,7 +130,7 @@ TEST_F(SimpleApiCallExtensionTest, RunTest) { reinterpret_cast(message_value.get()); std::string result; message_dict->GetString(keys::kAutomationNameKey, &result); - EXPECT_EQ(result, "RemoveTab"); + EXPECT_EQ(result, "tabs.remove"); result = ""; message_dict->GetString(keys::kAutomationArgsKey, &result); @@ -224,7 +224,7 @@ class RoundtripAutomationProxy : public MultiMessageAutomationProxy { &has_callback)); if (messages_received_ == 1) { - EXPECT_EQ(function_name, "GetLastFocusedWindow"); + EXPECT_EQ(function_name, "windows.getLastFocused"); EXPECT_GE(request_id, 0); EXPECT_TRUE(has_callback); @@ -241,7 +241,7 @@ class RoundtripAutomationProxy : public MultiMessageAutomationProxy { keys::kAutomationOrigin, keys::kAutomationResponseTarget); } else if (messages_received_ == 2) { - EXPECT_EQ(function_name, "RemoveTab"); + EXPECT_EQ(function_name, "tabs.remove"); EXPECT_FALSE(has_callback); std::string args; @@ -318,25 +318,25 @@ class BrowserEventAutomationProxy : public MultiMessageAutomationProxy { const char* BrowserEventAutomationProxy::event_names_[] = { // Window events. - "window-created", - "window-removed", - "window-focus-changed", + "windows.onCreated", + "windows.onRemoved", + "windows.onFocusChanged", // Tab events. - "tab-created", - "tab-updated", - "tab-moved", - "tab-selection-changed", - "tab-attached", - "tab-detached", - "tab-removed", + "tabs.onCreated", + "tabs.onUpdated", + "tabs.onMoved", + "tabs.onSelectionChanged", + "tabs.onAttached", + "tabs.onDetached", + "tabs.onRemoved", // Bookmark events. - "bookmark-added", - "bookmark-removed", - "bookmark-changed", - "bookmark-moved", - "bookmark-children-reordered", + "bookmarks.onAdded", + "bookmarks.onRemoved", + "bookmarks.onChanged", + "bookmarks.onMoved", + "bookmarks.onChildrenReordered", }; void BrowserEventAutomationProxy::HandleMessageFromChrome() { @@ -361,7 +361,7 @@ void BrowserEventAutomationProxy::HandleMessageFromChrome() { std::string name; message_dict->GetString(keys::kAutomationNameKey, &name); - ASSERT_STREQ(name.c_str(), "GetCurrentWindow"); + ASSERT_STREQ(name.c_str(), "windows.getCurrent"); // Send an OpenChannelToExtension message to chrome. Note: the JSON // reader expects quoted property keys. See the comment in -- cgit v1.1