chromium/third_party/blink/renderer/core/page/focus_controller_test.cc

// Copyright 2016 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "third_party/blink/renderer/core/page/focus_controller.h"

#include <memory>

#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/mojom/input/focus_type.mojom-blink.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_binding_for_core.h"
#include "third_party/blink/renderer/core/css/properties/longhands.h"
#include "third_party/blink/renderer/core/dom/element.h"
#include "third_party/blink/renderer/core/dom/scroll_marker_group_pseudo_element.h"
#include "third_party/blink/renderer/core/dom/scroll_marker_pseudo_element.h"
#include "third_party/blink/renderer/core/dom/shadow_root.h"
#include "third_party/blink/renderer/core/html/html_element.h"
#include "third_party/blink/renderer/core/html/html_slot_element.h"
#include "third_party/blink/renderer/core/testing/core_unit_test_helper.h"
#include "third_party/blink/renderer/core/testing/page_test_base.h"

namespace blink {

class FocusControllerTest : public PageTestBase {};

TEST_F(FocusControllerTest, SetInitialFocus) {}

TEST_F(FocusControllerTest, DoNotCrash1) {}

TEST_F(FocusControllerTest, DoNotCrash2) {}

TEST_F(FocusControllerTest, SetActiveOnInactiveDocument) {}

// This test is for crbug.com/733218
TEST_F(FocusControllerTest, SVGFocusableElementInForm) {}

TEST_F(FocusControllerTest, FindFocusableAfterElement) {}

TEST_F(FocusControllerTest, NextFocusableElementForImeAndAutofill) {}

TEST_F(FocusControllerTest, NextFocusableElementForImeAndAutofill_NoFormTag) {}

// Ignore a checkbox to streamline form submission.
TEST_F(FocusControllerTest, NextFocusableElementForImeAndAutofill_Checkbox) {}

// A <select> element should block a form submission.
TEST_F(FocusControllerTest, NextFocusableElementForImeAndAutofill_Select) {}

// A submit button is used to detect the end of a user form within a combined
// form. Combined form is a <form> element that encloses several user form (e.g.
// signin and signup). See the HTML in the test for clarity.
TEST_F(FocusControllerTest,
       NextFocusableElementForImeAndAutofill_SubmitButton) {}

// Test for FocusController::FindScopeOwnerSlotOrReadingFlowContainer().
TEST_F(FocusControllerTest, FindScopeOwnerSlotOrReadingFlowContainer) {}

// crbug.com/1508258
TEST_F(FocusControllerTest, FocusHasChangedShouldInvalidateFocusStyle) {}

class FocusControllerTestWithIframes : public RenderingTest {};

// A captcha should block a form submission.
TEST_F(FocusControllerTestWithIframes,
       NextFocusableElementForImeAndAutofill_Captcha) {}

TEST_F(FocusControllerTest, ScrollMarkersAreFocusable) {}

}  // namespace blink