OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/gfx/rect.h" | 6 #include "base/gfx/rect.h" |
7 #include "base/json_reader.h" | 7 #include "base/json_reader.h" |
8 #include "base/json_writer.h" | 8 #include "base/json_writer.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "chrome/browser/automation/extension_automation_constants.h" | 10 #include "chrome/browser/automation/extension_automation_constants.h" |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 private: | 95 private: |
96 DISALLOW_COPY_AND_ASSIGN(SimpleApiCallExtensionTest); | 96 DISALLOW_COPY_AND_ASSIGN(SimpleApiCallExtensionTest); |
97 }; | 97 }; |
98 | 98 |
99 // TODO(port) Should become portable once ExternalTabMessageLoop is ported. | 99 // TODO(port) Should become portable once ExternalTabMessageLoop is ported. |
100 #if defined(OS_WIN) | 100 #if defined(OS_WIN) |
101 TEST_F(SimpleApiCallExtensionTest, RunTest) { | 101 TEST_F(SimpleApiCallExtensionTest, RunTest) { |
102 namespace keys = extension_automation_constants; | 102 namespace keys = extension_automation_constants; |
103 | 103 |
104 TestWithURL(GURL( | 104 TestWithURL(GURL( |
105 "chrome-extension://77774444789ABCDEF0123456789ABCDEF0123456/test.html")); | 105 "chrome-extension://fc6f6ba6693faf6773c13701019f2e7a12f0febe/test.html")); |
106 AutomationProxyForExternalTab* proxy = | 106 AutomationProxyForExternalTab* proxy = |
107 static_cast<AutomationProxyForExternalTab*>(automation()); | 107 static_cast<AutomationProxyForExternalTab*>(automation()); |
108 ASSERT_GT(proxy->messages_received(), 0); | 108 ASSERT_GT(proxy->messages_received(), 0); |
109 | 109 |
110 // Using EXPECT_TRUE rather than EXPECT_EQ as the compiler (VC++) isn't | 110 // Using EXPECT_TRUE rather than EXPECT_EQ as the compiler (VC++) isn't |
111 // finding the right match for EqHelper. | 111 // finding the right match for EqHelper. |
112 EXPECT_TRUE(proxy->origin() == keys::kAutomationOrigin); | 112 EXPECT_TRUE(proxy->origin() == keys::kAutomationOrigin); |
113 EXPECT_TRUE(proxy->target() == keys::kAutomationRequestTarget); | 113 EXPECT_TRUE(proxy->target() == keys::kAutomationRequestTarget); |
114 | 114 |
115 scoped_ptr<Value> message_value(JSONReader::Read(proxy->message(), false)); | 115 scoped_ptr<Value> message_value(JSONReader::Read(proxy->message(), false)); |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 | 262 |
263 private: | 263 private: |
264 DISALLOW_COPY_AND_ASSIGN(RoundtripApiCallExtensionTest); | 264 DISALLOW_COPY_AND_ASSIGN(RoundtripApiCallExtensionTest); |
265 }; | 265 }; |
266 | 266 |
267 // TODO(port) Should become portable once | 267 // TODO(port) Should become portable once |
268 // ExternalTabMessageLoop is ported. | 268 // ExternalTabMessageLoop is ported. |
269 #if defined(OS_WIN) | 269 #if defined(OS_WIN) |
270 TEST_F(RoundtripApiCallExtensionTest, RunTest) { | 270 TEST_F(RoundtripApiCallExtensionTest, RunTest) { |
271 TestWithURL(GURL( | 271 TestWithURL(GURL( |
272 "chrome-extension://66664444789ABCDEF0123456789ABCDEF0123456/test.html")); | 272 "chrome-extension://e5ead92b2c6795c1d2b92df9c5cb37de5582471a/test.html")); |
273 RoundtripAutomationProxy* proxy = | 273 RoundtripAutomationProxy* proxy = |
274 static_cast<RoundtripAutomationProxy*>(automation()); | 274 static_cast<RoundtripAutomationProxy*>(automation()); |
275 | 275 |
276 // Validation is done in the RoundtripAutomationProxy, so we just check | 276 // Validation is done in the RoundtripAutomationProxy, so we just check |
277 // something basic here. | 277 // something basic here. |
278 EXPECT_EQ(proxy->messages_received(), 2); | 278 EXPECT_EQ(proxy->messages_received(), 2); |
279 } | 279 } |
280 #endif // defined(OS_WIN) | 280 #endif // defined(OS_WIN) |
281 | 281 |
282 } // namespace | 282 } // namespace |
OLD | NEW |