[M120 Migration] Add option to override test data directory 94/321094/4
authorJakub Gajownik <j.gajownik2@samsung.com>
Mon, 18 Nov 2024 15:08:58 +0000 (16:08 +0100)
committerBot Blink <blinkbot@samsung.com>
Thu, 28 Nov 2024 04:34:16 +0000 (04:34 +0000)
Ported port of patch:
https://review.tizen.org/gerrit/#/c/292710/
> [M108 Aura Migration][WebRTC] Port remote camera feature
>
> Port of the following patches from Tizen 7.0:
> - https://review.tizen.org/gerrit/275651/
> - https://review.tizen.org/gerrit/282398
>
> Bug: https://cam.sprc.samsung.pl/browse/VDGAME-259
> Change-Id: I70a5c74f343d2f23cc71092849cbbfc37151d48a
> Signed-off-by: Michal Jurkiewicz <m.jurkiewicz@samsung.com>

Only the part regarding test data directory, as rest
is not used from M120.

Bug: https://jira-eu.sec.samsung.net/browse/VDGAME-625
Change-Id: I9b79fe45a25dbe15d61a74cf3daa4a649bc88fd3
Signed-off-by: Jakub Gajownik <j.gajownik2@samsung.com>
media/base/media_switches.cc
media/base/media_switches.h
media/base/test_data_util.cc

index 78e337aaaeace36601bb57119d121b8e2f139a7f..f1e60d249eceb68a4f6fe7d4c60b3f2e294bf953 100644 (file)
@@ -264,6 +264,10 @@ MEDIA_EXPORT extern const char kLacrosUseChromeosProtectedAv1[] =
 const char kAllowRAInDevMode[] = "allow-ra-in-dev-mode";
 #endif  // BUILDFLAG(IS_CHROMEOS)
 
+#if BUILDFLAG(IS_TIZEN_TV)
+const char kTestDataDirPrefix[] = "test-data-dir-prefix";
+#endif  // BUILDFLAG(IS_TIZEN_TV)
+
 namespace autoplay {
 
 // Autoplay policy that requires a document user activation.
index 2d7cee34fed688dbdfc490624c705a77bc278d7e..f41927c7110bbb73cceb4a0e84d428938ae94b93 100644 (file)
@@ -113,6 +113,10 @@ MEDIA_EXPORT extern const char kLacrosUseChromeosProtectedAv1[];
 MEDIA_EXPORT extern const char kAllowRAInDevMode[];
 #endif  // BUILDFLAG(IS_CHROMEOS)
 
+#if BUILDFLAG(IS_TIZEN_TV)
+MEDIA_EXPORT extern const char kTestDataDirPrefix[];
+#endif  // BUILDFLAG(IS_TIZEN_TV)
+
 namespace autoplay {
 
 MEDIA_EXPORT extern const char kDocumentUserActivationRequiredPolicy[];
index 69a32f71c87e34ec67f577fd99b04e053b46433a..32e2f4984e96e31a418021b2fe52e2fef9e4df93 100644 (file)
@@ -8,12 +8,14 @@
 #include <ostream>
 
 #include "base/check_op.h"
+#include "base/command_line.h"
 #include "base/containers/flat_map.h"
 #include "base/files/file_util.h"
 #include "base/no_destructor.h"
 #include "base/numerics/safe_conversions.h"
 #include "base/path_service.h"
 #include "media/base/decoder_buffer.h"
+#include "media/base/media_switches.h"
 
 namespace media {
 
@@ -183,8 +185,18 @@ const base::FilePath::CharType kTestDataPath[] =
 
 base::FilePath GetTestDataFilePath(const std::string& name) {
   base::FilePath file_path;
+#if BUILDFLAG(IS_TIZEN_TV)
+  auto command_line = base::CommandLine::ForCurrentProcess();
+  if (command_line->HasSwitch(switches::kTestDataDirPrefix)) {
+    file_path = command_line->GetSwitchValuePath(switches::kTestDataDirPrefix);
+  } else {
+    CHECK(base::PathService::Get(base::DIR_SRC_TEST_DATA_ROOT, &file_path));
+  }
+  return file_path.Append(GetTestDataPath()).AppendASCII(name);
+#else
   CHECK(base::PathService::Get(base::DIR_SRC_TEST_DATA_ROOT, &file_path));
   return file_path.Append(GetTestDataPath()).AppendASCII(name);
+#endif  // BUILDFLAG(IS_TIZEN_TV)
 }
 
 base::FilePath GetTestDataPath() {