flutter_flutter/sky/engine/core/dom/TreeScopeTest.cpp
Hixie 6bcc09dbd0 Remove shadow trees and custom elements from sky/engine/.
Remove all code relating to shadow trees, insertion points, shadow
boundaries, traversing composed trees, distribution, template
documents, custom elements, registering elements, element registries,
element factories, shadow roots, etc.

Remove the following features from the IDLs and from the binding
generators: CustomElementCallbacks, Reflect*, EventHandler.

Remove the CSS custom pseudo-element concept, since we no longer have
a UA style sheet worth talking about, no longer have shadow trees or
custom elements, no longer use pseudo-elements, and generally
therefore don't use this code at all.
2015-07-20 13:31:12 -07:00

33 lines
1004 B
C++

// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "sky/engine/core/dom/TreeScope.h"
#include <gtest/gtest.h>
#include "sky/engine/core/dom/Document.h"
#include "sky/engine/core/dom/Element.h"
using namespace blink;
namespace {
TEST(TreeScopeTest, CommonAncestorOfSameTrees)
{
RefPtr<Document> document = Document::create();
EXPECT_EQ(document.get(), document->commonAncestorTreeScope(*document));
RefPtr<Element> html = document->createElement("html", nullAtom, ASSERT_NO_EXCEPTION);
document->appendChild(html, ASSERT_NO_EXCEPTION);
}
TEST(TreeScopeTest, CommonAncestorOfTreesInDifferentDocuments)
{
RefPtr<Document> document1 = Document::create();
RefPtr<Document> document2 = Document::create();
EXPECT_EQ(0, document1->commonAncestorTreeScope(*document2));
EXPECT_EQ(0, document2->commonAncestorTreeScope(*document1));
}
} // namespace