#include <string>
#include "base/command_line.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h"
#include "components/permissions/test/permission_request_observer.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/content_switches.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_utils.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "net/test/embedded_test_server/http_request.h"
#include "net/test/embedded_test_server/http_response.h"
#include "testing/gmock/include/gmock/gmock-matchers.h"
namespace {
std::unique_ptr<net::test_server::HttpResponse> RespondWithJS(
const std::string& path,
const std::string& content,
base::OnceClosure done_callback,
const net::test_server::HttpRequest& request) { … }
}
class WakeLockBrowserTest : public InProcessBrowserTest { … };
void WakeLockBrowserTest::SetUpCommandLine(base::CommandLine* command_line) { … }
void WakeLockBrowserTest::NavigateToSimplePage() { … }
void WakeLockBrowserTest::NavigateToAndRespondWithScript(
const std::string& path,
const std::string& script) { … }
IN_PROC_BROWSER_TEST_F(WakeLockBrowserTest, RequestScreenLockFromWorker) { … }
IN_PROC_BROWSER_TEST_F(WakeLockBrowserTest, RequestSystemLockFromWorker) { … }
IN_PROC_BROWSER_TEST_F(WakeLockBrowserTest, RequestPermissionScreen) { … }
IN_PROC_BROWSER_TEST_F(WakeLockBrowserTest,
RequestPermissionScreenNoUserGesture) { … }
IN_PROC_BROWSER_TEST_F(WakeLockBrowserTest, RequestPermissionSystem) { … }
IN_PROC_BROWSER_TEST_F(WakeLockBrowserTest,
RequestPermissionSystemNoUserGesture) { … }