Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 |
| OLD | NEW |