| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
| 8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
| 9 #include "base/test/test_timeouts.h" | 9 #include "base/test/test_timeouts.h" |
| 10 #include "components/view_manager/public/cpp/tests/view_manager_test_base.h" | 10 #include "components/view_manager/public/cpp/tests/view_manager_test_base.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 | 23 |
| 24 // Returns true if the tree contains a text node with contents matching |text|. | 24 // Returns true if the tree contains a text node with contents matching |text|. |
| 25 bool AxTreeContainsText(const Array<AxNodePtr>& tree, const String& text) { | 25 bool AxTreeContainsText(const Array<AxNodePtr>& tree, const String& text) { |
| 26 for (size_t i = 0; i < tree.size(); ++i) { | 26 for (size_t i = 0; i < tree.size(); ++i) { |
| 27 if (!tree[i]->text.is_null() && tree[i]->text->content == text) | 27 if (!tree[i]->text.is_null() && tree[i]->text->content == text) |
| 28 return true; | 28 return true; |
| 29 } | 29 } |
| 30 return false; | 30 return false; |
| 31 } | 31 } |
| 32 | 32 |
| 33 // Switch to enable out of process iframes. | 33 // Switch to disable out of process iframes. |
| 34 const char kOOPIF[] = "oopifs"; | 34 const char kDisableOOPIF[] = "disable--oopifs"; |
| 35 | 35 |
| 36 bool EnableOOPIFs() { | 36 bool EnableOOPIFs() { |
| 37 return base::CommandLine::ForCurrentProcess()->HasSwitch(kOOPIF); | 37 if (base::CommandLine::ForCurrentProcess()->HasSwitch(kDisableOOPIF)) |
| 38 return false; |
| 39 return true; |
| 38 } | 40 } |
| 39 | 41 |
| 40 class TestFrameTreeServer : public mandoline::FrameTreeServer { | 42 class TestFrameTreeServer : public mandoline::FrameTreeServer { |
| 41 public: | 43 public: |
| 42 TestFrameTreeServer() {} | 44 TestFrameTreeServer() {} |
| 43 ~TestFrameTreeServer() override {} | 45 ~TestFrameTreeServer() override {} |
| 44 | 46 |
| 45 // mandoline::FrameTreeServer: | 47 // mandoline::FrameTreeServer: |
| 46 void PostMessageEventToFrame(uint32_t source_frame_id, | 48 void PostMessageEventToFrame(uint32_t source_frame_id, |
| 47 uint32_t target_frame_id, | 49 uint32_t target_frame_id, |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 EXPECT_TRUE(QuitRunLoop()); | 120 EXPECT_TRUE(QuitRunLoop()); |
| 119 }); | 121 }); |
| 120 ASSERT_TRUE(DoRunLoopWithTimeout()); | 122 ASSERT_TRUE(DoRunLoopWithTimeout()); |
| 121 | 123 |
| 122 EXPECT_TRUE(AxTreeContainsText(ax_tree, "Hello ")); | 124 EXPECT_TRUE(AxTreeContainsText(ax_tree, "Hello ")); |
| 123 EXPECT_TRUE(AxTreeContainsText(ax_tree, "World!")); | 125 EXPECT_TRUE(AxTreeContainsText(ax_tree, "World!")); |
| 124 EXPECT_FALSE(AxTreeContainsText(ax_tree, "foo")); | 126 EXPECT_FALSE(AxTreeContainsText(ax_tree, "foo")); |
| 125 } | 127 } |
| 126 | 128 |
| 127 } // namespace mojo | 129 } // namespace mojo |
| OLD | NEW |