diff options
-rw-r--r-- | chrome/browser/automation/automation_extension_function.cc | 9 | ||||
-rw-r--r-- | chrome/browser/automation/extension_automation_constants.cc (renamed from chrome/test/automation/extension_automation_constants.cc) | 13 | ||||
-rw-r--r-- | chrome/browser/automation/extension_automation_constants.h | 40 | ||||
-rw-r--r-- | chrome/browser/browser.vcproj | 8 | ||||
-rw-r--r-- | chrome/browser/extensions/extension_uitest.cc | 2 | ||||
-rw-r--r-- | chrome/chrome.gyp | 5 | ||||
-rw-r--r-- | chrome/test/automation/extension_automation_constants.h | 24 | ||||
-rw-r--r-- | chrome/test/ui/ui_tests.vcproj | 12 |
8 files changed, 76 insertions, 37 deletions
diff --git a/chrome/browser/automation/automation_extension_function.cc b/chrome/browser/automation/automation_extension_function.cc index 314718a..776866e 100644 --- a/chrome/browser/automation/automation_extension_function.cc +++ b/chrome/browser/automation/automation_extension_function.cc @@ -8,16 +8,9 @@ #include "base/json_reader.h" #include "base/json_writer.h" +#include "chrome/browser/automation/extension_automation_constants.h" #include "chrome/browser/extensions/extension_function_dispatcher.h" #include "chrome/browser/renderer_host/render_view_host.h" -#include "chrome/test/automation/extension_automation_constants.h" - -// We are the only compilation unit outside of test code that needs the -// definition of these constants. Including the .cc file here instead of -// putting it into chrome.gyp (SCons builds on Linux don't like it when you -// have the same file in two different projects) or linking to the test support -// lib. -#include "chrome/test/automation/extension_automation_constants.cc" bool AutomationExtensionFunction::enabled_ = false; diff --git a/chrome/test/automation/extension_automation_constants.cc b/chrome/browser/automation/extension_automation_constants.cc index 99ecadb..425c634 100644 --- a/chrome/test/automation/extension_automation_constants.cc +++ b/chrome/browser/automation/extension_automation_constants.cc @@ -2,18 +2,27 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/test/automation/extension_automation_constants.h" +#include "chrome/browser/automation/extension_automation_constants.h" namespace extension_automation_constants { +const char kAutomationOrigin[] = "__priv_xtapi"; const wchar_t kAutomationRequestIdKey[] = L"rqid"; + const wchar_t kAutomationHasCallbackKey[] = L"hascb"; const wchar_t kAutomationErrorKey[] = L"err"; const wchar_t kAutomationNameKey[] = L"name"; const wchar_t kAutomationArgsKey[] = L"args"; const wchar_t kAutomationResponseKey[] = L"res"; -const char kAutomationOrigin[] = "__priv_xtapi"; const char kAutomationRequestTarget[] = "__priv_xtreq"; const char kAutomationResponseTarget[] = "__priv_xtres"; +const wchar_t kAutomationConnectionIdKey[] = L"connid"; +const wchar_t kAutomationMessageDataKey[] = L"data"; +const wchar_t kAutomationExtensionIdKey[] = L"extid"; +const wchar_t kAutomationPortIdKey[] = L"portid"; +const char kAutomationPortRequestTarget[] = "__priv_prtreq"; +const char kAutomationPortResponseTarget[] = "__priv_prtres"; + + } // namespace extension_automation_constants diff --git a/chrome/browser/automation/extension_automation_constants.h b/chrome/browser/automation/extension_automation_constants.h new file mode 100644 index 0000000..1c44548 --- /dev/null +++ b/chrome/browser/automation/extension_automation_constants.h @@ -0,0 +1,40 @@ +// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Constants used to encode requests and responses for automation. + +#ifndef CHROME_BROWSER_AUTOMATION_EXTENSION_AUTOMATION_CONSTANTS_H_ +#define CHROME_BROWSER_AUTOMATION_EXTENSION_AUTOMATION_CONSTANTS_H_ + +namespace extension_automation_constants { + +// All extension automation related messages will have this origin. +extern const char kAutomationOrigin[]; +// Key used for all extension automation request types. +extern const wchar_t kAutomationRequestIdKey[]; + +// Keys used for API communications +extern const wchar_t kAutomationHasCallbackKey[]; +extern const wchar_t kAutomationErrorKey[]; // not present implies success +extern const wchar_t kAutomationNameKey[]; +extern const wchar_t kAutomationArgsKey[]; +extern const wchar_t kAutomationResponseKey[]; +// All external API requests have this target. +extern const char kAutomationRequestTarget[]; +// All API responses should have this target. +extern const char kAutomationResponseTarget[]; + +// Keys used for port communications +extern const wchar_t kAutomationConnectionIdKey[]; +extern const wchar_t kAutomationMessageDataKey[]; +extern const wchar_t kAutomationExtensionIdKey[]; +extern const wchar_t kAutomationPortIdKey[]; +// All external port message requests should have this target. +extern const char kAutomationPortRequestTarget[]; +// All external port message responses have this target. +extern const char kAutomationPortResponseTarget[]; + +}; // namespace automation_extension_constants + +#endif // CHROME_BROWSER_AUTOMATION_EXTENSION_AUTOMATION_CONSTANTS_H_ diff --git a/chrome/browser/browser.vcproj b/chrome/browser/browser.vcproj index bc92287..a3d7b39 100644 --- a/chrome/browser/browser.vcproj +++ b/chrome/browser/browser.vcproj @@ -916,6 +916,14 @@ > </File> <File + RelativePath=".\automation\extension_automation_constants.cc" + > + </File> + <File + RelativePath=".\automation\extension_automation_constants.h" + > + </File> + <File RelativePath=".\automation\extension_port_container.cc" > </File> diff --git a/chrome/browser/extensions/extension_uitest.cc b/chrome/browser/extensions/extension_uitest.cc index da075ca..867a13a 100644 --- a/chrome/browser/extensions/extension_uitest.cc +++ b/chrome/browser/extensions/extension_uitest.cc @@ -7,9 +7,9 @@ #include "base/json_reader.h" #include "base/json_writer.h" #include "base/values.h" +#include "chrome/browser/automation/extension_automation_constants.h" #include "chrome/common/chrome_switches.h" #include "chrome/test/automation/automation_proxy_uitest.h" -#include "chrome/test/automation/extension_automation_constants.h" #include "chrome/test/automation/tab_proxy.h" #include "chrome/test/ui/ui_test.h" #include "googleurl/src/gurl.h" diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp index 52408d4..bc0647d 100644 --- a/chrome/chrome.gyp +++ b/chrome/chrome.gyp @@ -524,6 +524,8 @@ 'browser/automation/automation_autocomplete_edit_tracker.h', 'browser/automation/automation_browser_tracker.h', 'browser/automation/automation_constrained_window_tracker.h', + 'browser/automation/extension_automation_constants.h', + 'browser/automation/extension_automation_constants.cc', 'browser/automation/automation_extension_function.h', 'browser/automation/automation_extension_function.cc', 'browser/automation/automation_provider.cc', @@ -2519,8 +2521,6 @@ 'test/automation/browser_proxy.h', 'test/automation/constrained_window_proxy.cc', 'test/automation/constrained_window_proxy.h', - 'test/automation/extension_automation_constants.h', - 'test/automation/extension_automation_constants.cc', 'test/automation/tab_proxy.cc', 'test/automation/tab_proxy.h', 'test/automation/window_proxy.cc', @@ -2678,6 +2678,7 @@ 'browser/download/download_uitest.cc', 'browser/download/save_page_uitest.cc', 'browser/errorpage_uitest.cc', + 'browser/extensions/extension_uitest.cc', 'browser/history/redirect_uitest.cc', 'browser/iframe_uitest.cc', 'browser/images_uitest.cc', diff --git a/chrome/test/automation/extension_automation_constants.h b/chrome/test/automation/extension_automation_constants.h deleted file mode 100644 index 715c379..0000000 --- a/chrome/test/automation/extension_automation_constants.h +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Constants used to encode requests and responses for automation. - -#ifndef CHROME_TEST_AUTOMATION_EXTENSION_AUTOMATION_CONSTANTS_H_ -#define CHROME_TEST_AUTOMATION_EXTENSION_AUTOMATION_CONSTANTS_H_ - -namespace extension_automation_constants { - -extern const wchar_t kAutomationRequestIdKey[]; -extern const wchar_t kAutomationHasCallbackKey[]; -extern const wchar_t kAutomationErrorKey[]; // not present implies success -extern const wchar_t kAutomationNameKey[]; -extern const wchar_t kAutomationArgsKey[]; -extern const wchar_t kAutomationResponseKey[]; -extern const char kAutomationOrigin[]; -extern const char kAutomationRequestTarget[]; -extern const char kAutomationResponseTarget[]; - -}; // namespace automation_extension_constants - -#endif // CHROME_TEST_AUTOMATION_EXTENSION_AUTOMATION_CONSTANTS_H_ diff --git a/chrome/test/ui/ui_tests.vcproj b/chrome/test/ui/ui_tests.vcproj index b72989e..e50ff06 100644 --- a/chrome/test/ui/ui_tests.vcproj +++ b/chrome/test/ui/ui_tests.vcproj @@ -301,6 +301,10 @@ RelativePath="..\automation\automation_proxy_uitest.cc" > </File> + <File + RelativePath="..\automation\automation_proxy_uitest.h" + > + </File> </Filter> <Filter Name="TestNPAPI" @@ -594,6 +598,14 @@ > </File> </Filter> + <Filter + Name="TestExtensions" + > + <File + RelativePath="..\..\browser\extensions\extension_uitest.cc" + > + </File> + </Filter> </Files> <Globals> </Globals> |