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

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: 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 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 container->getRegistration(scriptState(), ""); 366 container->getRegistration(scriptState(), "");
367 EXPECT_EQ(1ul, stubProvider.getRegistrationCallCount()); 367 EXPECT_EQ(1ul, stubProvider.getRegistrationCallCount());
368 EXPECT_EQ(WebURL(KURL(KURL(), "http://localhost/x/index.html")), stubPro vider.getRegistrationURL()); 368 EXPECT_EQ(WebURL(KURL(KURL(), "http://localhost/x/index.html")), stubPro vider.getRegistrationURL());
369 } 369 }
370 370
371 container->willBeDetachedFromFrame(); 371 container->willBeDetachedFromFrame();
372 } 372 }
373 373
374 TEST_F(ServiceWorkerContainerTest, GetClientInfo) 374 TEST_F(ServiceWorkerContainerTest, GetClientInfo)
375 { 375 {
376 setVisibilityState(PageVisibilityStateVisible); 376 setVisibilityState(PageVisibilityStateHidden);
377 setFocused(true); 377 setFocused(true);
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("hidden"), 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);
nhiroki 2014/12/08 08:01:09 How about calling setVisibilityState(Visible) and
Kunihiko Sakamoto 2014/12/08 08:34:10 Done.
388 } 388 }
389 389
390 } // namespace 390 } // namespace
391 } // namespace blink 391 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698