| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "config.h" | 31 #include "config.h" |
| 32 #include "public/web/WebScopedWindowFocusAllowedIndicator.h" | 32 #include "public/web/WebScopedWindowFocusAllowedIndicator.h" |
| 33 | 33 |
| 34 #include "core/dom/Document.h" | 34 #include "core/dom/Document.h" |
| 35 #include "public/web/WebDocument.h" | 35 #include "public/web/WebDocument.h" |
| 36 #include <gtest/gtest.h> | 36 #include <gtest/gtest.h> |
| 37 | 37 |
| 38 using namespace blink; | 38 namespace blink { |
| 39 | |
| 40 namespace { | |
| 41 | 39 |
| 42 TEST(WebScopedWindowFocusAllowedIndicatorTest, Basic) | 40 TEST(WebScopedWindowFocusAllowedIndicatorTest, Basic) |
| 43 { | 41 { |
| 44 RefPtrWillBePersistent<Document> document = Document::create(); | 42 RefPtrWillBePersistent<Document> document = Document::create(); |
| 45 WebDocument webDocument(document); | 43 WebDocument webDocument(document); |
| 46 | 44 |
| 47 EXPECT_FALSE(document->isWindowInteractionAllowed()); | 45 EXPECT_FALSE(document->isWindowInteractionAllowed()); |
| 48 { | 46 { |
| 49 WebScopedWindowFocusAllowedIndicator indicator1(&webDocument); | 47 WebScopedWindowFocusAllowedIndicator indicator1(&webDocument); |
| 50 EXPECT_TRUE(document->isWindowInteractionAllowed()); | 48 EXPECT_TRUE(document->isWindowInteractionAllowed()); |
| 51 { | 49 { |
| 52 WebScopedWindowFocusAllowedIndicator indicator2(&webDocument); | 50 WebScopedWindowFocusAllowedIndicator indicator2(&webDocument); |
| 53 EXPECT_TRUE(document->isWindowInteractionAllowed()); | 51 EXPECT_TRUE(document->isWindowInteractionAllowed()); |
| 54 } | 52 } |
| 55 EXPECT_TRUE(document->isWindowInteractionAllowed()); | 53 EXPECT_TRUE(document->isWindowInteractionAllowed()); |
| 56 } | 54 } |
| 57 EXPECT_FALSE(document->isWindowInteractionAllowed()); | 55 EXPECT_FALSE(document->isWindowInteractionAllowed()); |
| 58 } | 56 } |
| 59 | 57 |
| 60 } | 58 } // namespace blink |
| OLD | NEW |