[ads] Cleanup test utiliy file names.
This commit is contained in:
+1
-1
@@ -166,7 +166,7 @@ void CreativeSearchResultAdTabHelper::MaybeHandleCreativeAdViewedEvent(
|
||||
const std::string& placement_id) {
|
||||
CHECK(!placement_id.empty());
|
||||
|
||||
// It is safe to pass placement_id directly to the JavaScript function as it
|
||||
// It is safe to pass `placement_id` directly to the JavaScript function as it
|
||||
// has all characters except alphanumerics and -._~ escaped.
|
||||
const std::string javascript = base::ReplaceStringPlaceholders(
|
||||
kDataPlacementIdVisibilityCheckJavaScript, {placement_id}, nullptr);
|
||||
|
||||
@@ -40,8 +40,8 @@ source_set("unit_tests") {
|
||||
"creatives/search_result_ad/creative_search_result_ad_mojom_unittest_util.cc",
|
||||
"creatives/search_result_ad/creative_search_result_ad_mojom_unittest_util.h",
|
||||
"creatives/search_result_ad/creative_search_result_ad_mojom_web_page_entities_extractor_unittest.cc",
|
||||
"creatives/search_result_ad/creative_search_result_ad_mojom_web_page_entities_for_testing.cc",
|
||||
"creatives/search_result_ad/creative_search_result_ad_mojom_web_page_entities_for_testing.h",
|
||||
"creatives/search_result_ad/creative_search_result_ad_mojom_web_page_entities_test_util.cc",
|
||||
"creatives/search_result_ad/creative_search_result_ad_mojom_web_page_entities_test_util.h",
|
||||
"creatives/search_result_ad/creative_search_result_ad_unittest_constants.h",
|
||||
"creatives/search_result_ad/creative_search_result_ad_url_placement_id_extractor_unittest.cc",
|
||||
]
|
||||
|
||||
+2
-2
@@ -15,7 +15,7 @@
|
||||
#include "brave/components/brave_ads/browser/ads_service_mock.h"
|
||||
#include "brave/components/brave_ads/content/browser/creatives/search_result_ad/creative_search_result_ad_constants.h"
|
||||
#include "brave/components/brave_ads/content/browser/creatives/search_result_ad/creative_search_result_ad_mojom_web_page_entities_extractor.h"
|
||||
#include "brave/components/brave_ads/content/browser/creatives/search_result_ad/creative_search_result_ad_mojom_web_page_entities_for_testing.h"
|
||||
#include "brave/components/brave_ads/content/browser/creatives/search_result_ad/creative_search_result_ad_mojom_web_page_entities_test_util.h"
|
||||
#include "brave/components/brave_ads/content/browser/creatives/search_result_ad/creative_search_result_ad_unittest_constants.h"
|
||||
#include "brave/components/brave_ads/core/mojom/brave_ads.mojom-shared.h"
|
||||
#include "brave/components/brave_ads/core/public/ads_feature.h"
|
||||
@@ -390,7 +390,7 @@ TEST_F(BraveAdsCreativeSearchResultAdHandlerTest,
|
||||
}
|
||||
|
||||
TEST_F(BraveAdsCreativeSearchResultAdHandlerTest,
|
||||
TriggerViewedAndClickedAdEventsWithUnreservedCharactersPlacementId) {
|
||||
TriggerViewedAndClickedAdEventsWithUnreservedCharactersInPlacementId) {
|
||||
// Arrange
|
||||
const auto creative_search_result_ad_handler =
|
||||
CreativeSearchResultAdHandler::MaybeCreate(
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
|
||||
#include "brave/components/brave_ads/content/browser/creatives/search_result_ad/creative_search_result_ad_constants.h"
|
||||
#include "brave/components/brave_ads/content/browser/creatives/search_result_ad/creative_search_result_ad_mojom_unittest_util.h"
|
||||
#include "brave/components/brave_ads/content/browser/creatives/search_result_ad/creative_search_result_ad_mojom_web_page_entities_for_testing.h"
|
||||
#include "brave/components/brave_ads/content/browser/creatives/search_result_ad/creative_search_result_ad_mojom_web_page_entities_test_util.h"
|
||||
#include "brave/components/brave_ads/content/browser/creatives/search_result_ad/creative_search_result_ad_unittest_constants.h"
|
||||
#include "brave/components/brave_ads/core/mojom/brave_ads.mojom.h" // IWYU pragma: keep
|
||||
#include "components/schema_org/common/metadata.mojom.h"
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "brave/components/brave_ads/content/browser/creatives/search_result_ad/creative_search_result_ad_mojom_web_page_entities_for_testing.h"
|
||||
#include "brave/components/brave_ads/content/browser/creatives/search_result_ad/creative_search_result_ad_mojom_web_page_entities_test_util.h"
|
||||
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
+3
-3
@@ -3,8 +3,8 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#ifndef BRAVE_COMPONENTS_BRAVE_ADS_CONTENT_BROWSER_CREATIVES_SEARCH_RESULT_AD_CREATIVE_SEARCH_RESULT_AD_MOJOM_WEB_PAGE_ENTITIES_FOR_TESTING_H_
|
||||
#define BRAVE_COMPONENTS_BRAVE_ADS_CONTENT_BROWSER_CREATIVES_SEARCH_RESULT_AD_CREATIVE_SEARCH_RESULT_AD_MOJOM_WEB_PAGE_ENTITIES_FOR_TESTING_H_
|
||||
#ifndef BRAVE_COMPONENTS_BRAVE_ADS_CONTENT_BROWSER_CREATIVES_SEARCH_RESULT_AD_CREATIVE_SEARCH_RESULT_AD_MOJOM_WEB_PAGE_ENTITIES_TEST_UTIL_H_
|
||||
#define BRAVE_COMPONENTS_BRAVE_ADS_CONTENT_BROWSER_CREATIVES_SEARCH_RESULT_AD_CREATIVE_SEARCH_RESULT_AD_MOJOM_WEB_PAGE_ENTITIES_TEST_UTIL_H_
|
||||
|
||||
#include <string_view>
|
||||
#include <vector>
|
||||
@@ -31,4 +31,4 @@ blink::mojom::WebPagePtr CreativeSearchResultAdMojomWebPageWithProperty(
|
||||
|
||||
} // namespace brave_ads::test
|
||||
|
||||
#endif // BRAVE_COMPONENTS_BRAVE_ADS_CONTENT_BROWSER_CREATIVES_SEARCH_RESULT_AD_CREATIVE_SEARCH_RESULT_AD_MOJOM_WEB_PAGE_ENTITIES_FOR_TESTING_H_
|
||||
#endif // BRAVE_COMPONENTS_BRAVE_ADS_CONTENT_BROWSER_CREATIVES_SEARCH_RESULT_AD_CREATIVE_SEARCH_RESULT_AD_MOJOM_WEB_PAGE_ENTITIES_TEST_UTIL_H_
|
||||
+4
-4
@@ -13,6 +13,10 @@ namespace brave_ads::test {
|
||||
// Creative ad.
|
||||
inline constexpr char kCreativeAdPlacementId[] =
|
||||
"953f362e-98cd-4fa6-8403-e886185b88fc";
|
||||
inline constexpr char kCreativeAdPlacementIdWithUnreservedCharacters[] =
|
||||
"\"'+*&%";
|
||||
inline constexpr char kEscapedCreativeAdPlacementIdWithUnreservedCharacters[] =
|
||||
"%22%27%2B%2A%26%25";
|
||||
inline constexpr char kCreativeAdCreativeInstanceId[] =
|
||||
"d94f98e6-74f8-41cf-bfb2-3d753b94f8ef";
|
||||
inline constexpr char kCreativeAdCreativeSetId[] =
|
||||
@@ -25,10 +29,6 @@ inline constexpr char kCreativeAdLandingPage[] = "https://brave.com";
|
||||
inline constexpr char kCreativeAdHeadlineText[] = "Headline text";
|
||||
inline constexpr char kCreativeAdDescription[] = "Description";
|
||||
inline constexpr double kCreativeAdRewardsValue = 0.5;
|
||||
inline constexpr char kCreativeAdPlacementIdWithUnreservedCharacters[] =
|
||||
"\"'+*&%";
|
||||
inline constexpr char kEscapedCreativeAdPlacementIdWithUnreservedCharacters[] =
|
||||
"%22%27%2B%2A%26%25";
|
||||
|
||||
// Creative set conversion.
|
||||
inline constexpr char kCreativeSetConversionUrlPattern[] =
|
||||
|
||||
Reference in New Issue
Block a user