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

Side by Side Diff: Source/modules/serviceworkers/ServiceWorkerContainerTest.cpp

Issue 778703004: Implement ServiceWorkerClient attributes [3/3] (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@properties-step1
Patch Set: Protect by a runtime flag Created 6 years 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "config.h" 5 #include "config.h"
6 #include "modules/serviceworkers/ServiceWorkerContainer.h" 6 #include "modules/serviceworkers/ServiceWorkerContainer.h"
7 7
8 #include "bindings/core/v8/Dictionary.h" 8 #include "bindings/core/v8/Dictionary.h"
9 #include "bindings/core/v8/ScriptFunction.h" 9 #include "bindings/core/v8/ScriptFunction.h"
10 #include "bindings/core/v8/ScriptPromise.h" 10 #include "bindings/core/v8/ScriptPromise.h"
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 setPageURL("http://localhost/x/index.html"); 378 setPageURL("http://localhost/x/index.html");
379 379
380 ServiceWorkerContainer* container = ServiceWorkerContainer::create(execution Context()); 380 ServiceWorkerContainer* container = ServiceWorkerContainer::create(execution Context());
381 381
382 WebServiceWorkerClientInfo info; 382 WebServiceWorkerClientInfo info;
383 ASSERT_TRUE(container->getClientInfo(&info)); 383 ASSERT_TRUE(container->getClientInfo(&info));
384 EXPECT_EQ(WebString("visible"), info.visibilityState); 384 EXPECT_EQ(WebString("visible"), info.visibilityState);
385 EXPECT_TRUE(info.isFocused); 385 EXPECT_TRUE(info.isFocused);
386 EXPECT_EQ(WebURL(KURL(KURL(), "http://localhost/x/index.html")), info.url); 386 EXPECT_EQ(WebURL(KURL(KURL(), "http://localhost/x/index.html")), info.url);
387 EXPECT_EQ(WebURLRequest::FrameTypeTopLevel, info.frameType); 387 EXPECT_EQ(WebURLRequest::FrameTypeTopLevel, info.frameType);
388
389 setVisibilityState(PageVisibilityStateHidden);
390 setFocused(false);
391 ASSERT_TRUE(container->getClientInfo(&info));
392 EXPECT_EQ(WebString("hidden"), info.visibilityState);
393 EXPECT_FALSE(info.isFocused);
388 } 394 }
389 395
390 } // namespace 396 } // namespace
391 } // namespace blink 397 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/serviceworkers/ServiceWorkerClients.cpp ('k') | Source/platform/RuntimeEnabledFeatures.in » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698