OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/common/extensions/extension.h" | 5 #include "chrome/common/extensions/extension.h" |
6 | 6 |
7 #if defined(TOOLKIT_GTK) | 7 #if defined(TOOLKIT_GTK) |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
542 error_msg = ""; | 542 error_msg = ""; |
543 | 543 |
544 // Test that keys "popup" and "default_popup" both work, but can not | 544 // Test that keys "popup" and "default_popup" both work, but can not |
545 // be used at the same time. | 545 // be used at the same time. |
546 input.Clear(); | 546 input.Clear(); |
547 input.SetString(keys::kPageActionDefaultTitle, kTitle); | 547 input.SetString(keys::kPageActionDefaultTitle, kTitle); |
548 input.SetString(keys::kPageActionDefaultIcon, kIcon); | 548 input.SetString(keys::kPageActionDefaultIcon, kIcon); |
549 | 549 |
550 // LoadExtensionActionHelper expects the extension member |extension_url| | 550 // LoadExtensionActionHelper expects the extension member |extension_url| |
551 // to be set. | 551 // to be set. |
552 extension.mutable_static_data_->extension_url = | 552 extension.extension_url_ = |
553 GURL(std::string(chrome::kExtensionScheme) + | 553 GURL(std::string(chrome::kExtensionScheme) + |
554 chrome::kStandardSchemeSeparator + | 554 chrome::kStandardSchemeSeparator + |
555 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/"); | 555 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/"); |
556 | 556 |
557 // Add key "popup", expect success. | 557 // Add key "popup", expect success. |
558 input.SetString(keys::kPageActionPopup, kPopupHtmlFile); | 558 input.SetString(keys::kPageActionPopup, kPopupHtmlFile); |
559 action.reset(extension.LoadExtensionActionHelper(&input, &error_msg)); | 559 action.reset(extension.LoadExtensionActionHelper(&input, &error_msg)); |
560 ASSERT_TRUE(NULL != action.get()); | 560 ASSERT_TRUE(NULL != action.get()); |
561 ASSERT_TRUE(error_msg.empty()); | 561 ASSERT_TRUE(error_msg.empty()); |
562 ASSERT_STREQ( | 562 ASSERT_STREQ( |
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1160 EXPECT_TRUE(Extension::GenerateId("test", &result)); | 1160 EXPECT_TRUE(Extension::GenerateId("test", &result)); |
1161 EXPECT_EQ(result, "jpignaibiiemhngfjkcpokkamffknabf"); | 1161 EXPECT_EQ(result, "jpignaibiiemhngfjkcpokkamffknabf"); |
1162 | 1162 |
1163 EXPECT_TRUE(Extension::GenerateId("_", &result)); | 1163 EXPECT_TRUE(Extension::GenerateId("_", &result)); |
1164 EXPECT_EQ(result, "ncocknphbhhlhkikpnnlmbcnbgdempcd"); | 1164 EXPECT_EQ(result, "ncocknphbhhlhkikpnnlmbcnbgdempcd"); |
1165 | 1165 |
1166 EXPECT_TRUE(Extension::GenerateId( | 1166 EXPECT_TRUE(Extension::GenerateId( |
1167 "this_string_is_longer_than_a_single_sha256_hash_digest", &result)); | 1167 "this_string_is_longer_than_a_single_sha256_hash_digest", &result)); |
1168 EXPECT_EQ(result, "jimneklojkjdibfkgiiophfhjhbdgcfi"); | 1168 EXPECT_EQ(result, "jimneklojkjdibfkgiiophfhjhbdgcfi"); |
1169 } | 1169 } |
OLD | NEW |