| 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 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |
| OLD | NEW |