chromium/third_party/blink/renderer/core/html/forms/external_date_time_chooser_test.cc

// Copyright 2019 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/html/forms/external_date_time_chooser.h"

#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/core/frame/local_frame_view.h"
#include "third_party/blink/renderer/core/html/forms/date_time_chooser_client.h"
#include "third_party/blink/renderer/core/html/forms/html_input_element.h"
#include "third_party/blink/renderer/core/testing/dummy_page_holder.h"
#include "third_party/blink/renderer/core/testing/null_execution_context.h"
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
#include "third_party/blink/renderer/platform/testing/runtime_enabled_features_test_helpers.h"
#include "third_party/blink/renderer/platform/testing/task_environment.h"

namespace blink {

class ExternalDateTimeChooserTest : public testing::Test {};

class TestDateTimeChooserClient final
    : public GarbageCollected<TestDateTimeChooserClient>,
      public DateTimeChooserClient {};

// This is a regression test for crbug.com/974646. EndChooser can cause a crash
// when it's called twice because |client_| was already nullptr.
TEST_F(ExternalDateTimeChooserTest, EndChooserShouldNotCrash) {}

// This is a regression test for crbug.com/1022302. When the label and the value
// are the same in an option element,
// HTMLInputElement::SetupDateTimeChooserParameters had set a null value. This
// caused a crash because Mojo message pipe couldn't get a null pointer at the
// receiving side.
TEST_F(ExternalDateTimeChooserTest,
       OpenDateTimeChooserShouldNotCrashWhenLabelAndValueIsTheSame) {}

}  // namespace blink