| 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 20 matching lines...) Expand all  Loading... | 
|  31 #include "public/web/WebScopedWindowFocusAllowedIndicator.h" |  31 #include "public/web/WebScopedWindowFocusAllowedIndicator.h" | 
|  32  |  32  | 
|  33 #include "core/dom/Document.h" |  33 #include "core/dom/Document.h" | 
|  34 #include "public/web/WebDocument.h" |  34 #include "public/web/WebDocument.h" | 
|  35 #include "testing/gtest/include/gtest/gtest.h" |  35 #include "testing/gtest/include/gtest/gtest.h" | 
|  36  |  36  | 
|  37 namespace blink { |  37 namespace blink { | 
|  38  |  38  | 
|  39 TEST(WebScopedWindowFocusAllowedIndicatorTest, Basic) |  39 TEST(WebScopedWindowFocusAllowedIndicatorTest, Basic) | 
|  40 { |  40 { | 
|  41     RefPtrWillBePersistent<Document> document = Document::create(); |  41     Persistent<Document> document = Document::create(); | 
|  42     WebDocument webDocument(document); |  42     WebDocument webDocument(document); | 
|  43  |  43  | 
|  44     EXPECT_FALSE(document->isWindowInteractionAllowed()); |  44     EXPECT_FALSE(document->isWindowInteractionAllowed()); | 
|  45     { |  45     { | 
|  46         WebScopedWindowFocusAllowedIndicator indicator1(&webDocument); |  46         WebScopedWindowFocusAllowedIndicator indicator1(&webDocument); | 
|  47         EXPECT_TRUE(document->isWindowInteractionAllowed()); |  47         EXPECT_TRUE(document->isWindowInteractionAllowed()); | 
|  48         { |  48         { | 
|  49             WebScopedWindowFocusAllowedIndicator indicator2(&webDocument); |  49             WebScopedWindowFocusAllowedIndicator indicator2(&webDocument); | 
|  50             EXPECT_TRUE(document->isWindowInteractionAllowed()); |  50             EXPECT_TRUE(document->isWindowInteractionAllowed()); | 
|  51         } |  51         } | 
|  52         EXPECT_TRUE(document->isWindowInteractionAllowed()); |  52         EXPECT_TRUE(document->isWindowInteractionAllowed()); | 
|  53     } |  53     } | 
|  54     EXPECT_FALSE(document->isWindowInteractionAllowed()); |  54     EXPECT_FALSE(document->isWindowInteractionAllowed()); | 
|  55 } |  55 } | 
|  56  |  56  | 
|  57 } // namespace blink |  57 } // namespace blink | 
| OLD | NEW |