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

Unified Diff: src/chrome_app/apis.py

Issue 1685693004: Chrome URL bugfix + added tests for chrome_app.apis. (Closed) Base URL: https://github.com/chromium/caterpillar.git@master
Patch Set: Line consistency fix. Created 4 years, 10 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 | « no previous file | src/chrome_app/apis_test.py » ('j') | src/chrome_app/apis_test.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/chrome_app/apis.py
diff --git a/src/chrome_app/apis.py b/src/chrome_app/apis.py
index fa09a1a32f86857e7c6d720440eceed80179ac2e..ad3933b05659ade4e6d7ba4fff3827fad24b4fcb 100755
--- a/src/chrome_app/apis.py
+++ b/src/chrome_app/apis.py
@@ -42,19 +42,21 @@ import walk
# Regular expression matching Chrome API namespaces, e.g. chrome.tts and
# chrome.app.window.
CHROME_API_REGEX = re.compile(
- r'(?<![\w.])chrome\.((?:(?:app|sockets|system)\.)?\w+)')
+ r'(?<![\w.])chrome\.(?!google)((?:(?:app|sockets|system)\.)?\w+)')
# Regular expression matching Chrome apps API usage, e.g.
# chrome.tts.speak and chrome.app.runtime.onLaunched.addListener.
-CHROME_API_USAGE_REGEX = re.compile(r'(?<![\w.])chrome\.((?:\w+\.)+\w+)')
+CHROME_API_USAGE_REGEX = re.compile(
+ r'(?<![\w.])chrome\.(?!google)((?:\w+\.)+\w+)')
# Regular expression matching anything in the chrome namespace, e.g. chrome.tts
# or chrome.app.runtime.onLaunched.addListener.
-CHROME_NAMESPACE_REGEX = re.compile(r'chrome((?:\.\w+)+)')
+CHROME_NAMESPACE_REGEX = re.compile(r'chrome((?:\.(?!google)\w+)+)')
# Regular expression matching both the API and the member, assuming both exist.
CHROME_API_AND_MEMBER_REGEX = re.compile(r"""
(?<![\w.])chrome\. # In the chrome namespace
+ (?!google) # chrome.google is not an API
Matt Giuca 2016/02/11 02:17:12 Mmmmmm... I don't like this. As you said in the CL
( # Capture the full API name
(?:(?:app|sockets|system)\.)? # API may be part of a super-API namespace
\w+ # Actual API name
« no previous file with comments | « no previous file | src/chrome_app/apis_test.py » ('j') | src/chrome_app/apis_test.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698