diff options
author | rafaelw@chromium.org <rafaelw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-16 22:20:00 +0000 |
---|---|---|
committer | rafaelw@chromium.org <rafaelw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-16 22:20:00 +0000 |
commit | 434c21e053a20e5d417125a62f6f9de31258a8ce (patch) | |
tree | 67e26ed41a65e474c7e5fa45bddf791e1897f492 /chrome/browser/extensions/extension_uitest.cc | |
parent | 44b4b0ccfdfc1ca2a8a56094d86a554b79f43ce7 (diff) | |
download | chromium_src-434c21e053a20e5d417125a62f6f9de31258a8ce.zip chromium_src-434c21e053a20e5d417125a62f6f9de31258a8ce.tar.gz chromium_src-434c21e053a20e5d417125a62f6f9de31258a8ce.tar.bz2 |
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
Diffstat (limited to 'chrome/browser/extensions/extension_uitest.cc')
-rw-r--r-- | chrome/browser/extensions/extension_uitest.cc | 38 |
1 files changed, 19 insertions, 19 deletions
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<DictionaryValue*>(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 |