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

Unified Diff: chrome/test/data/native_messaging/native_hosts/echo.py

Issue 1809383004: Set current directory when launching Native Messaging processes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « chrome/common/extensions/docs/templates/articles/nativeMessaging.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/native_messaging/native_hosts/echo.py
diff --git a/chrome/test/data/native_messaging/native_hosts/echo.py b/chrome/test/data/native_messaging/native_hosts/echo.py
index 33aa789f8253c72a06c59823fd9d40ccf2e3c1ae..28e02f735555f8af58de220e97df68ce4fc72018 100755
--- a/chrome/test/data/native_messaging/native_hosts/echo.py
+++ b/chrome/test/data/native_messaging/native_hosts/echo.py
@@ -38,6 +38,14 @@ def Main():
elif caller_url == None:
caller_url = arg
+ # Verify that the process was started in the correct directory.
+ cwd = os.getcwd()
+ script_path = os.path.dirname(os.path.abspath(sys.argv[0]))
+ if cwd.lower() != script_path.lower():
+ sys.stderr.write('Native messaging host started in a wrong directory.')
+ return 1
+
+ # Verify that --parent-window parameter is correct.
if platform.system() == 'Windows' and parent_window:
import win32gui
if not win32gui.IsWindow(parent_window):
« no previous file with comments | « chrome/common/extensions/docs/templates/articles/nativeMessaging.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698