Index: chrome/common/chrome_paths.cc |
diff --git a/chrome/common/chrome_paths.cc b/chrome/common/chrome_paths.cc |
index abe5da30baf5dcb2d74b9d6d30df55046b2bf062..6794d68cf8ed647b6cbac4e80d5e419e3f442392 100644 |
--- a/chrome/common/chrome_paths.cc |
+++ b/chrome/common/chrome_paths.cc |
@@ -363,8 +363,28 @@ bool PathProvider(int key, base::FilePath* result) { |
cur = cur.Append(kWidevineCdmBaseDirectory); |
break; |
case chrome::FILE_WIDEVINE_CDM_PLUGIN: |
+#if defined(OS_MACOSX) |
+ // This is only for testing. The production path uses DIR_WIDEVINE_CDM. |
+ // Find the adapter (and CDM) in the directory where it gets built. |
+ // Use DIR_MODULE because it is consistent in both browser and renderers. |
+ if (!PathService::Get(base::DIR_MODULE, &cur)) |
+ return false; |
+ if (base::mac::AmIBundled()) { |
+ // If we're called from chrome, it's beside the app (outside the |
+ // app bundle), if we're called from a unittest, we'll already be |
+ // outside the bundle so use the exe dir. |
+ // DIR_MODULE gave us .../ |
xhwang
2013/05/02 19:39:17
what's .../ ?
ddorwin
2013/05/02 20:35:57
Done.
|
+ // Chromium.app/Contents/Versions/<v>/Google Chrome Framework.framework. |
+ cur = cur.DirName(); |
+ cur = cur.DirName(); |
+ cur = cur.DirName(); |
+ cur = cur.DirName(); |
+ cur = cur.DirName(); |
xhwang
2013/05/02 19:39:17
why call this 5 times?
ddorwin
2013/05/02 20:35:57
Each one returns the parent directory I guess. The
|
+ } |
+#else |
if (!GetInternalPluginsDirectory(&cur)) |
return false; |
+#endif |
cur = cur.Append(kWidevineCdmPluginFileName); |
break; |
#endif |