summaryrefslogtreecommitdiffstats
path: root/dom/quota/test/gtest/TestScopedLogExtraInfo.cpp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
commit40a355a42d4a9444dc753c04c6608dade2f06a23 (patch)
tree871fc667d2de662f171103ce5ec067014ef85e61 /dom/quota/test/gtest/TestScopedLogExtraInfo.cpp
parentAdding upstream version 124.0.1. (diff)
downloadfirefox-adbda400be353e676059e335c3c0aaf99e719475.tar.xz
firefox-adbda400be353e676059e335c3c0aaf99e719475.zip
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/quota/test/gtest/TestScopedLogExtraInfo.cpp')
-rw-r--r--dom/quota/test/gtest/TestScopedLogExtraInfo.cpp31
1 files changed, 23 insertions, 8 deletions
diff --git a/dom/quota/test/gtest/TestScopedLogExtraInfo.cpp b/dom/quota/test/gtest/TestScopedLogExtraInfo.cpp
index 00a3393844..395246c1fb 100644
--- a/dom/quota/test/gtest/TestScopedLogExtraInfo.cpp
+++ b/dom/quota/test/gtest/TestScopedLogExtraInfo.cpp
@@ -16,19 +16,23 @@ TEST(DOM_Quota_ScopedLogExtraInfo, AddAndRemove)
{
const auto extraInfo =
- ScopedLogExtraInfo{ScopedLogExtraInfo::kTagQuery, text};
+ ScopedLogExtraInfo{ScopedLogExtraInfo::kTagQueryTainted, text};
#ifdef QM_SCOPED_LOG_EXTRA_INFO_ENABLED
const auto& extraInfoMap = ScopedLogExtraInfo::GetExtraInfoMap();
- EXPECT_EQ(text, *extraInfoMap.at(ScopedLogExtraInfo::kTagQuery));
+ const auto& queryValueTainted =
+ *extraInfoMap.at(ScopedLogExtraInfo::kTagQueryTainted);
+
+ EXPECT_EQ(text, MOZ_NO_VALIDATE(queryValueTainted,
+ "It's ok to use query value in tests."));
#endif
}
#ifdef QM_SCOPED_LOG_EXTRA_INFO_ENABLED
const auto& extraInfoMap = ScopedLogExtraInfo::GetExtraInfoMap();
- EXPECT_EQ(0u, extraInfoMap.count(ScopedLogExtraInfo::kTagQuery));
+ EXPECT_EQ(0u, extraInfoMap.count(ScopedLogExtraInfo::kTagQueryTainted));
#endif
}
@@ -39,27 +43,38 @@ TEST(DOM_Quota_ScopedLogExtraInfo, Nested)
{
const auto extraInfo =
- ScopedLogExtraInfo{ScopedLogExtraInfo::kTagQuery, text};
+ ScopedLogExtraInfo{ScopedLogExtraInfo::kTagQueryTainted, text};
{
const auto extraInfo =
- ScopedLogExtraInfo{ScopedLogExtraInfo::kTagQuery, nestedText};
+ ScopedLogExtraInfo{ScopedLogExtraInfo::kTagQueryTainted, nestedText};
#ifdef QM_SCOPED_LOG_EXTRA_INFO_ENABLED
const auto& extraInfoMap = ScopedLogExtraInfo::GetExtraInfoMap();
- EXPECT_EQ(nestedText, *extraInfoMap.at(ScopedLogExtraInfo::kTagQuery));
+
+ const auto& queryValueTainted =
+ *extraInfoMap.at(ScopedLogExtraInfo::kTagQueryTainted);
+
+ EXPECT_EQ(nestedText,
+ MOZ_NO_VALIDATE(queryValueTainted,
+ "It's ok to use query value in tests."));
#endif
}
#ifdef QM_SCOPED_LOG_EXTRA_INFO_ENABLED
const auto& extraInfoMap = ScopedLogExtraInfo::GetExtraInfoMap();
- EXPECT_EQ(text, *extraInfoMap.at(ScopedLogExtraInfo::kTagQuery));
+
+ const auto& queryValueTainted =
+ *extraInfoMap.at(ScopedLogExtraInfo::kTagQueryTainted);
+
+ EXPECT_EQ(text, MOZ_NO_VALIDATE(queryValueTainted,
+ "It's ok to use query value in tests."));
#endif
}
#ifdef QM_SCOPED_LOG_EXTRA_INFO_ENABLED
const auto& extraInfoMap = ScopedLogExtraInfo::GetExtraInfoMap();
- EXPECT_EQ(0u, extraInfoMap.count(ScopedLogExtraInfo::kTagQuery));
+ EXPECT_EQ(0u, extraInfoMap.count(ScopedLogExtraInfo::kTagQueryTainted));
#endif
}