OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 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 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 | 269 |
270 // Register the mocked frame and load it. | 270 // Register the mocked frame and load it. |
271 RegisterMockedURLLoad(kURL, "simple_test.mht"); | 271 RegisterMockedURLLoad(kURL, "simple_test.mht"); |
272 LoadURLInTopFrame(ToKURL(kURL)); | 272 LoadURLInTopFrame(ToKURL(kURL)); |
273 ASSERT_TRUE(GetPage()); | 273 ASSERT_TRUE(GetPage()); |
274 LocalFrame* frame = ToLocalFrame(GetPage()->MainFrame()); | 274 LocalFrame* frame = ToLocalFrame(GetPage()->MainFrame()); |
275 ASSERT_TRUE(frame); | 275 ASSERT_TRUE(frame); |
276 Document* document = frame->GetDocument(); | 276 Document* document = frame->GetDocument(); |
277 ASSERT_TRUE(document); | 277 ASSERT_TRUE(document); |
278 | 278 |
279 // Full sandboxing should be turned on. | 279 // Full sandboxing with the exception to new top-level windows should be |
280 EXPECT_TRUE(document->IsSandboxed(kSandboxAll)); | 280 // turned on. |
| 281 EXPECT_EQ(kSandboxAll & ~(kSandboxPopups | |
| 282 kSandboxPropagatesToAuxiliaryBrowsingContexts), |
| 283 document->GetSandboxFlags()); |
281 | 284 |
282 // MHTML document should be loaded into unique origin. | 285 // MHTML document should be loaded into unique origin. |
283 EXPECT_TRUE(document->GetSecurityOrigin()->IsUnique()); | 286 EXPECT_TRUE(document->GetSecurityOrigin()->IsUnique()); |
284 // Script execution should be disabled. | 287 // Script execution should be disabled. |
285 EXPECT_FALSE(document->CanExecuteScripts(kNotAboutToExecuteScript)); | 288 EXPECT_FALSE(document->CanExecuteScripts(kNotAboutToExecuteScript)); |
286 } | 289 } |
287 | 290 |
288 } // namespace blink | 291 } // namespace blink |
OLD | NEW |