Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(524)

Side by Side Diff: third_party/WebKit/Source/web/tests/IntersectionObserverTest.cpp

Issue 2046973003: IntersectionObserver: throw exceptions as spec mandates. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/dom/IntersectionObserver.idl ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/dom/IntersectionObserver.h" 5 #include "core/dom/IntersectionObserver.h"
6 6
7 #include "core/dom/IntersectionObserverCallback.h" 7 #include "core/dom/IntersectionObserverCallback.h"
8 #include "core/dom/IntersectionObserverInit.h" 8 #include "core/dom/IntersectionObserverInit.h"
9 #include "platform/testing/UnitTestHelpers.h" 9 #include "platform/testing/UnitTestHelpers.h"
10 #include "web/WebViewImpl.h" 10 #include "web/WebViewImpl.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 mainResource.complete("<div id='target'></div>"); 46 mainResource.complete("<div id='target'></div>");
47 47
48 IntersectionObserverInit observerInit; 48 IntersectionObserverInit observerInit;
49 TrackExceptionState exceptionState; 49 TrackExceptionState exceptionState;
50 TestIntersectionObserverCallback* observerCallback = new TestIntersectionObs erverCallback(document()); 50 TestIntersectionObserverCallback* observerCallback = new TestIntersectionObs erverCallback(document());
51 IntersectionObserver* observer = IntersectionObserver::create(observerInit, *observerCallback, exceptionState); 51 IntersectionObserver* observer = IntersectionObserver::create(observerInit, *observerCallback, exceptionState);
52 ASSERT_FALSE(exceptionState.hadException()); 52 ASSERT_FALSE(exceptionState.hadException());
53 53
54 compositor().beginFrame(); 54 compositor().beginFrame();
55 ASSERT_FALSE(compositor().needsAnimate()); 55 ASSERT_FALSE(compositor().needsAnimate());
56 EXPECT_TRUE(observer->takeRecords().isEmpty()); 56 EXPECT_TRUE(observer->takeRecords(exceptionState).isEmpty());
57 EXPECT_EQ(observerCallback->callCount(), 0); 57 EXPECT_EQ(observerCallback->callCount(), 0);
58 58
59 Element* target = document().getElementById("target"); 59 Element* target = document().getElementById("target");
60 ASSERT_TRUE(target); 60 ASSERT_TRUE(target);
61 observer->observe(target); 61 observer->observe(target, exceptionState);
62 EXPECT_TRUE(compositor().needsAnimate()); 62 EXPECT_TRUE(compositor().needsAnimate());
63 } 63 }
64 64
65 } // namespace blink 65 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/IntersectionObserver.idl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698