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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 public: | 94 public: |
95 SimpleApiCallExtensionTest() | 95 SimpleApiCallExtensionTest() |
96 : SingleMessageExtensionUITest(kTestDirectorySimpleApiCall) { | 96 : SingleMessageExtensionUITest(kTestDirectorySimpleApiCall) { |
97 } | 97 } |
98 | 98 |
99 private: | 99 private: |
100 DISALLOW_COPY_AND_ASSIGN(SimpleApiCallExtensionTest); | 100 DISALLOW_COPY_AND_ASSIGN(SimpleApiCallExtensionTest); |
101 }; | 101 }; |
102 | 102 |
103 // TODO(port) Should become portable once ExternalTabMessageLoop is ported. | 103 // TODO(port) Should become portable once ExternalTabMessageLoop is ported. |
104 #if defined(OS_WIN) | 104 #if 0 |
105 TEST_F(SimpleApiCallExtensionTest, RunTest) { | 105 TEST_F(SimpleApiCallExtensionTest, RunTest) { |
106 namespace keys = extension_automation_constants; | 106 namespace keys = extension_automation_constants; |
107 | 107 |
108 TestWithURL(GURL( | 108 TestWithURL(GURL( |
109 "chrome-extension://pmgpglkggjdpkpghhdmbdhababjpcohk/test.html")); | 109 "chrome-extension://pmgpglkggjdpkpghhdmbdhababjpcohk/test.html")); |
110 AutomationProxyForExternalTab* proxy = | 110 AutomationProxyForExternalTab* proxy = |
111 static_cast<AutomationProxyForExternalTab*>(automation()); | 111 static_cast<AutomationProxyForExternalTab*>(automation()); |
112 ASSERT_GT(proxy->messages_received(), 0); | 112 ASSERT_GT(proxy->messages_received(), 0); |
113 | 113 |
114 // Using EXPECT_TRUE rather than EXPECT_EQ as the compiler (VC++) isn't | 114 // Using EXPECT_TRUE rather than EXPECT_EQ as the compiler (VC++) isn't |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 static_cast<RoundtripAutomationProxy*>(automation()); | 263 static_cast<RoundtripAutomationProxy*>(automation()); |
264 proxy->tab_ = tab; | 264 proxy->tab_ = tab; |
265 } | 265 } |
266 | 266 |
267 private: | 267 private: |
268 DISALLOW_COPY_AND_ASSIGN(RoundtripApiCallExtensionTest); | 268 DISALLOW_COPY_AND_ASSIGN(RoundtripApiCallExtensionTest); |
269 }; | 269 }; |
270 | 270 |
271 // TODO(port) Should become portable once | 271 // TODO(port) Should become portable once |
272 // ExternalTabMessageLoop is ported. | 272 // ExternalTabMessageLoop is ported. |
273 #if defined(OS_WIN) | 273 #if 0 |
274 TEST_F(RoundtripApiCallExtensionTest, RunTest) { | 274 TEST_F(RoundtripApiCallExtensionTest, RunTest) { |
275 TestWithURL(GURL( | 275 TestWithURL(GURL( |
276 "chrome-extension://ofoknjclcmghjfmbncljcnpjmfmldhno/test.html")); | 276 "chrome-extension://ofoknjclcmghjfmbncljcnpjmfmldhno/test.html")); |
277 RoundtripAutomationProxy* proxy = | 277 RoundtripAutomationProxy* proxy = |
278 static_cast<RoundtripAutomationProxy*>(automation()); | 278 static_cast<RoundtripAutomationProxy*>(automation()); |
279 | 279 |
280 // Validation is done in the RoundtripAutomationProxy, so we just check | 280 // Validation is done in the RoundtripAutomationProxy, so we just check |
281 // something basic here. | 281 // something basic here. |
282 EXPECT_EQ(proxy->messages_received(), 2); | 282 EXPECT_EQ(proxy->messages_received(), 2); |
283 } | 283 } |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
428 proxy->tab_ = tab; | 428 proxy->tab_ = tab; |
429 } | 429 } |
430 | 430 |
431 private: | 431 private: |
432 | 432 |
433 DISALLOW_COPY_AND_ASSIGN(BrowserEventExtensionTest); | 433 DISALLOW_COPY_AND_ASSIGN(BrowserEventExtensionTest); |
434 }; | 434 }; |
435 | 435 |
436 // TODO(port) Should become portable once | 436 // TODO(port) Should become portable once |
437 // ExternalTabMessageLoop is ported. | 437 // ExternalTabMessageLoop is ported. |
438 #if defined(OS_WIN) | 438 #if 0 |
439 TEST_F(BrowserEventExtensionTest, RunTest) { | 439 TEST_F(BrowserEventExtensionTest, RunTest) { |
440 // The extension for this test does not specify a "key" property in its | 440 // The extension for this test does not specify a "key" property in its |
441 // manifest file. Therefore, the extension system will automatically assign | 441 // manifest file. Therefore, the extension system will automatically assign |
442 // it an Id. To make this test consistent and non-flaky, the genetated Id | 442 // it an Id. To make this test consistent and non-flaky, the genetated Id |
443 // counter is reset before the test so that we can hardcode the first Id | 443 // counter is reset before the test so that we can hardcode the first Id |
444 // that will be generated. | 444 // that will be generated. |
445 Extension::ResetGeneratedIdCounter(); | 445 Extension::ResetGeneratedIdCounter(); |
446 TestWithURL(GURL( | 446 TestWithURL(GURL( |
447 "chrome-extension://aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/test.html")); | 447 "chrome-extension://aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/test.html")); |
448 BrowserEventAutomationProxy* proxy = | 448 BrowserEventAutomationProxy* proxy = |
449 static_cast<BrowserEventAutomationProxy*>(automation()); | 449 static_cast<BrowserEventAutomationProxy*>(automation()); |
450 | 450 |
451 EXPECT_EQ(arraysize(BrowserEventAutomationProxy::event_names_), | 451 EXPECT_EQ(arraysize(BrowserEventAutomationProxy::event_names_), |
452 proxy->event_count_.size()); | 452 proxy->event_count_.size()); |
453 for (std::map<std::string, int>::iterator i = proxy->event_count_.begin(); | 453 for (std::map<std::string, int>::iterator i = proxy->event_count_.begin(); |
454 i != proxy->event_count_.end(); ++i) { | 454 i != proxy->event_count_.end(); ++i) { |
455 const std::pair<std::string, int>& value = *i; | 455 const std::pair<std::string, int>& value = *i; |
456 ASSERT_EQ(1, value.second); | 456 ASSERT_EQ(1, value.second); |
457 } | 457 } |
458 } | 458 } |
459 #endif // defined(OS_WIN) | 459 #endif // defined(OS_WIN) |
460 | 460 |
461 } // namespace | 461 } // namespace |
OLD | NEW |