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

Side by Side Diff: third_party/WebKit/Source/modules/presentation/PresentationAvailabilityTest.cpp

Issue 2148643002: [Presentation API] Adds DOMString[] constructor to PresentationRequest. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix LayoutTests Created 4 years, 5 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "modules/presentation/PresentationAvailability.h" 5 #include "modules/presentation/PresentationAvailability.h"
6 6
7 #include "bindings/core/v8/ScriptPromiseResolver.h" 7 #include "bindings/core/v8/ScriptPromiseResolver.h"
8 #include "bindings/core/v8/V8BindingForTesting.h" 8 #include "bindings/core/v8/V8BindingForTesting.h"
9 #include "core/frame/LocalFrame.h" 9 #include "core/frame/LocalFrame.h"
10 #include "core/page/Page.h" 10 #include "core/page/Page.h"
11 #include "core/testing/DummyPageHolder.h" 11 #include "core/testing/DummyPageHolder.h"
12 #include "platform/testing/URLTestHelpers.h" 12 #include "platform/testing/URLTestHelpers.h"
13 #include "platform/weborigin/KURL.h" 13 #include "platform/weborigin/KURL.h"
14 #include "testing/gtest/include/gtest/gtest.h" 14 #include "testing/gtest/include/gtest/gtest.h"
15 #include "wtf/Vector.h"
15 #include <v8.h> 16 #include <v8.h>
16 17
17 namespace blink { 18 namespace blink {
18 namespace { 19 namespace {
19 20
20 TEST(PresentationAvailabilityTest, NoPageVisibilityChangeAfterDetach) 21 TEST(PresentationAvailabilityTest, NoPageVisibilityChangeAfterDetach)
21 { 22 {
22 V8TestingScope scope; 23 V8TestingScope scope;
23 const KURL url = URLTestHelpers::toKURL("https://example.com"); 24 WTF::Vector<KURL> urls;
25 urls.append(URLTestHelpers::toKURL("https://example.com"));
26 urls.append(URLTestHelpers::toKURL("https://another.com"));
27
24 Persistent<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(s cope.getScriptState()); 28 Persistent<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(s cope.getScriptState());
25 Persistent<PresentationAvailability> availability = PresentationAvailability ::take(resolver, url, false); 29 Persistent<PresentationAvailability> availability = PresentationAvailability ::take(resolver, urls, false);
26 30
27 // These two calls should not crash. 31 // These two calls should not crash.
28 scope.frame().detach(FrameDetachType::Remove); 32 scope.frame().detach(FrameDetachType::Remove);
29 scope.page().setVisibilityState(PageVisibilityStateHidden, false); 33 scope.page().setVisibilityState(PageVisibilityStateHidden, false);
30 } 34 }
31 35
32 } // anonymous namespace 36 } // anonymous namespace
33 } // namespace blink 37 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698