#include "base/files/file_path.h"
#include "base/strings/stringprintf.h"
#include "base/values.h"
#include "build/build_config.h"
#include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/devtools/devtools_window_testing.h"
#include "chrome/browser/extensions/chrome_test_extension_loader.h"
#include "chrome/browser/policy/policy_test_utils.h"
#include "chrome/browser/profiles/profile.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/url_constants.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/interactive_test_utils.h"
#include "chrome/test/base/ui_test_utils.h"
#include "components/policy/core/common/policy_map.h"
#include "components/policy/policy_constants.h"
#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/web_contents.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/no_renderer_crashes_assertion.h"
#include "content/public/test/test_utils.h"
#include "extensions/browser/api/messaging/messaging_delegate.h"
#include "extensions/common/extension.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "third_party/blink/public/common/chrome_debug_urls.h"
ManifestLocation;
namespace policy {
namespace {
void WaitForExtensionsDevModeControlsVisibility(
content::WebContents* contents,
const char* dev_controls_accessor_js,
const char* dev_controls_visibility_check_js,
bool expected_visible) { … }
PolicyMap MakeDeveloperToolsAvailabilityMap(int value) { … }
void NavigateToURLNoWait(Browser* browser, const GURL& url) { … }
void VerifyPageAllowsKill(Browser* browser, const GURL& url) { … }
void VerifyPageBlocksKill(Browser* browser, const GURL& url) { … }
bool PageAllowsJavascriptURL(Browser* browser, const GURL& url) { … }
}
IN_PROC_BROWSER_TEST_F(PolicyTest, DeveloperToolsDisabledByLegacyPolicy) { … }
IN_PROC_BROWSER_TEST_F(PolicyTest,
DeveloperToolsDisabledByDeveloperToolsAvailability) { … }
IN_PROC_BROWSER_TEST_F(PolicyTest, AvailabilityWins) { … }
IN_PROC_BROWSER_TEST_F(PolicyTest,
ViewSourceDisabledByDeveloperToolsAvailability) { … }
IN_PROC_BROWSER_TEST_F(PolicyTest, DeveloperToolsDisabledExtensionsDevMode) { … }
#if BUILDFLAG(GOOGLE_CHROME_BRANDING) && BUILDFLAG(IS_WIN)
#define MAYBE_DebugURLsDisabledByDeveloperToolsAvailability …
#else
#define MAYBE_DebugURLsDisabledByDeveloperToolsAvailability …
#endif
IN_PROC_BROWSER_TEST_F(PolicyTest,
MAYBE_DebugURLsDisabledByDeveloperToolsAvailability) { … }
}