summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/extension_test_api.cc
diff options
context:
space:
mode:
authorasargent@chromium.org <asargent@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-02 04:08:07 +0000
committerasargent@chromium.org <asargent@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-02 04:08:07 +0000
commit745feedbf4bd357333c156b222728863abdbe4c2 (patch)
tree2873aca4d78a4f8629bdcbffc32f95eb7dd33bb5 /chrome/browser/extensions/extension_test_api.cc
parent1cc549438eaddc8c2443e5d6487928e5c5574794 (diff)
downloadchromium_src-745feedbf4bd357333c156b222728863abdbe4c2.zip
chromium_src-745feedbf4bd357333c156b222728863abdbe4c2.tar.gz
chromium_src-745feedbf4bd357333c156b222728863abdbe4c2.tar.bz2
Set a max limit on extension items' labels in context menus.
Also do some cleanup of context menu tests, including adding a generic mechanism to let javascript pass a test message and have C++ test code wait for and retrieve those messages. BUG=49744 TEST=Follow steps in bug report Review URL: http://codereview.chromium.org/3017047 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54514 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_test_api.cc')
-rw-r--r--chrome/browser/extensions/extension_test_api.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/chrome/browser/extensions/extension_test_api.cc b/chrome/browser/extensions/extension_test_api.cc
index e5ae650..e9e46be 100644
--- a/chrome/browser/extensions/extension_test_api.cc
+++ b/chrome/browser/extensions/extension_test_api.cc
@@ -4,6 +4,8 @@
#include "chrome/browser/extensions/extension_test_api.h"
+#include <string>
+
#include "chrome/browser/browser.h"
#include "chrome/browser/profile.h"
#include "chrome/browser/extensions/extensions_service.h"
@@ -50,3 +52,14 @@ bool ExtensionTestCreateIncognitoTabFunction::RunImpl() {
Browser::OpenURLOffTheRecord(profile(), GURL(url));
return true;
}
+
+bool ExtensionTestSendMessageFunction::RunImpl() {
+ std::string message;
+ EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &message));
+ std::string id = extension_id();
+ NotificationService::current()->Notify(
+ NotificationType::EXTENSION_TEST_MESSAGE,
+ Source<std::string>(&id),
+ Details<std::string>(&message));
+ return true;
+}