#include <string_view>
#include "chrome/browser/page_load_metrics/observers/foreground_duration_ukm_observer.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_commands.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/webui_url_constants.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h"
#include "components/page_load_metrics/browser/page_load_metrics_test_waiter.h"
#include "components/ukm/test_ukm_recorder.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/fenced_frame_test_util.h"
#include "content/public/test/test_utils.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "services/metrics/public/cpp/ukm_builders.h"
#include "services/metrics/public/cpp/ukm_source.h"
#include "testing/gtest/include/gtest/gtest-param-test.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/features.h"
#include "ui/base/window_open_disposition.h"
#include "url/gurl.h"
namespace {
constexpr char kGatsbyJsPageLoad[] = …;
constexpr char kNextJsPageLoad[] = …;
constexpr char kNuxtJsPageLoad[] = …;
constexpr char kSapperPageLoad[] = …;
constexpr char kVuePressPageLoad[] = …;
constexpr char kAngularPageLoad[] = …;
constexpr char kPreactPageLoad[] = …;
constexpr char kReactPageLoad[] = …;
constexpr char kSveltePageLoad[] = …;
constexpr char kVuePageLoad[] = …;
constexpr char kDrupalPageLoad[] = …;
constexpr char kJoomlaPageLoad[] = …;
constexpr char kShopifyPageLoad[] = …;
constexpr char kSquarespacePageLoad[] = …;
constexpr char kWixPageLoad[] = …;
constexpr char kWordPressPageLoad[] = …;
const std::vector<std::string_view> all_frameworks = …;
const std::vector<std::string_view> all_content_management_systems = …;
}
class JavascriptFrameworksUkmObserverBrowserTest : public InProcessBrowserTest { … };
IN_PROC_BROWSER_TEST_F(JavascriptFrameworksUkmObserverBrowserTest,
NoFrameworkDetected) { … }
IN_PROC_BROWSER_TEST_F(JavascriptFrameworksUkmObserverBrowserTest,
GatsbyFrameworkDetected) { … }
IN_PROC_BROWSER_TEST_F(JavascriptFrameworksUkmObserverBrowserTest,
NextjsFrameworkDetected) { … }
IN_PROC_BROWSER_TEST_F(JavascriptFrameworksUkmObserverBrowserTest,
NuxtjsFrameworkDetected) { … }
IN_PROC_BROWSER_TEST_F(JavascriptFrameworksUkmObserverBrowserTest,
SapperFrameworkDetected) { … }
IN_PROC_BROWSER_TEST_F(JavascriptFrameworksUkmObserverBrowserTest,
VuePressFrameworkDetected) { … }
IN_PROC_BROWSER_TEST_F(JavascriptFrameworksUkmObserverBrowserTest,
MultipleFrameworksDetected) { … }
IN_PROC_BROWSER_TEST_F(JavascriptFrameworksUkmObserverBrowserTest,
AngularFrameworkDetected) { … }
IN_PROC_BROWSER_TEST_F(JavascriptFrameworksUkmObserverBrowserTest,
PreactFrameworkDetected) { … }
IN_PROC_BROWSER_TEST_F(JavascriptFrameworksUkmObserverBrowserTest,
ReactFrameworkDetected1) { … }
IN_PROC_BROWSER_TEST_F(JavascriptFrameworksUkmObserverBrowserTest,
ReactFrameworkDetected2) { … }
IN_PROC_BROWSER_TEST_F(JavascriptFrameworksUkmObserverBrowserTest,
ReactFrameworkDetected3) { … }
IN_PROC_BROWSER_TEST_F(JavascriptFrameworksUkmObserverBrowserTest,
ReactFrameworkDetected4) { … }
IN_PROC_BROWSER_TEST_F(JavascriptFrameworksUkmObserverBrowserTest,
ReactFrameworkDetected5) { … }
IN_PROC_BROWSER_TEST_F(JavascriptFrameworksUkmObserverBrowserTest,
ReactFrameworkDetected6) { … }
IN_PROC_BROWSER_TEST_F(JavascriptFrameworksUkmObserverBrowserTest,
SvelteFrameworkDetected) { … }
IN_PROC_BROWSER_TEST_F(JavascriptFrameworksUkmObserverBrowserTest,
VueFrameworkDetected1) { … }
IN_PROC_BROWSER_TEST_F(JavascriptFrameworksUkmObserverBrowserTest,
VueFrameworkDetected2) { … }
IN_PROC_BROWSER_TEST_F(JavascriptFrameworksUkmObserverBrowserTest,
VueFrameworkDetected3) { … }
IN_PROC_BROWSER_TEST_F(JavascriptFrameworksUkmObserverBrowserTest,
DrupalCMSDetected) { … }
IN_PROC_BROWSER_TEST_F(JavascriptFrameworksUkmObserverBrowserTest,
JoomlaCMSDetected) { … }
IN_PROC_BROWSER_TEST_F(JavascriptFrameworksUkmObserverBrowserTest,
ShopifyCMSDetected) { … }
IN_PROC_BROWSER_TEST_F(JavascriptFrameworksUkmObserverBrowserTest,
SquarespaceCMSDetected) { … }
IN_PROC_BROWSER_TEST_F(JavascriptFrameworksUkmObserverBrowserTest,
WixCMSDetected) { … }
IN_PROC_BROWSER_TEST_F(JavascriptFrameworksUkmObserverBrowserTest,
WordPressCMSDetected) { … }
IN_PROC_BROWSER_TEST_F(JavascriptFrameworksUkmObserverBrowserTest,
NoFrameworksDetectedInFencedFrame) { … }
IN_PROC_BROWSER_TEST_F(JavascriptFrameworksUkmObserverBrowserTest,
AngularVersionDetected) { … }
IN_PROC_BROWSER_TEST_F(JavascriptFrameworksUkmObserverBrowserTest,
AngularClampedVersionDetected) { … }
IN_PROC_BROWSER_TEST_F(JavascriptFrameworksUkmObserverBrowserTest,
DrupalVersionDetected) { … }
IN_PROC_BROWSER_TEST_F(JavascriptFrameworksUkmObserverBrowserTest,
NextJSVersionDetected) { … }
IN_PROC_BROWSER_TEST_F(JavascriptFrameworksUkmObserverBrowserTest,
Vue2VersionDetected) { … }
IN_PROC_BROWSER_TEST_F(JavascriptFrameworksUkmObserverBrowserTest,
Vue3VersionDetected) { … }
IN_PROC_BROWSER_TEST_F(JavascriptFrameworksUkmObserverBrowserTest,
WordPressVersionDetected) { … }
IN_PROC_BROWSER_TEST_F(JavascriptFrameworksUkmObserverBrowserTest,
NoFrameworkVersionDetected) { … }
IN_PROC_BROWSER_TEST_F(JavascriptFrameworksUkmObserverBrowserTest,
NoFrameworkVersionDetectedBadValues) { … }