Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(742)

Side by Side Diff: chrome/browser/extensions/extension_ui_unittest.cc

Issue 126074: Change extension id format back to mp-decimal, and change the (Closed)
Patch Set: make all the tests work again Created 11 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_uitest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-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/path_service.h" 5 #include "base/path_service.h"
6 #include "base/string_util.h" 6 #include "base/string_util.h"
7 #include "chrome/browser/extensions/extensions_ui.h" 7 #include "chrome/browser/extensions/extensions_ui.h"
8 #include "chrome/common/chrome_paths.h" 8 #include "chrome/common/chrome_paths.h"
9 #include "chrome/common/extensions/extension.h" 9 #include "chrome/common/extensions/extension.h"
10 #include "chrome/common/json_value_serializer.h" 10 #include "chrome/common/json_value_serializer.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 class ExtensionUITest : public testing::Test { 60 class ExtensionUITest : public testing::Test {
61 }; 61 };
62 62
63 TEST(ExtensionUITest, GenerateExtensionsJSONData) { 63 TEST(ExtensionUITest, GenerateExtensionsJSONData) {
64 FilePath data_test_dir_path, extension_path, expected_output_path; 64 FilePath data_test_dir_path, extension_path, expected_output_path;
65 EXPECT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &data_test_dir_path)); 65 EXPECT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &data_test_dir_path));
66 66
67 // Test Extension1 67 // Test Extension1
68 extension_path = data_test_dir_path.AppendASCII("extensions") 68 extension_path = data_test_dir_path.AppendASCII("extensions")
69 .AppendASCII("good") 69 .AppendASCII("good")
70 .AppendASCII("extension1") 70 .AppendASCII("behllobkkfkfnphdnhnkndlbkcpglgmj")
71 .AppendASCII("1"); 71 .AppendASCII("1.0.0.0");
72 72
73 std::vector<ExtensionPage> pages; 73 std::vector<ExtensionPage> pages;
74 pages.push_back(ExtensionPage(GURL("chrome-extension://foo/bar.html"), 74 pages.push_back(ExtensionPage(
75 42, 88)); 75 GURL("chrome-extension://behllobkkfkfnphdnhnkndlbkcpglgmj/bar.html"),
76 pages.push_back(ExtensionPage(GURL("chrome-extension://hot/dog.html"), 76 42, 88));
77 0, 0)); 77 pages.push_back(ExtensionPage(
78 GURL("chrome-extension://behllobkkfkfnphdnhnkndlbkcpglgmj/dog.html"),
79 0, 0));
78 80
79 expected_output_path = data_test_dir_path.AppendASCII("extensions") 81 expected_output_path = data_test_dir_path.AppendASCII("extensions")
80 .AppendASCII("ui") 82 .AppendASCII("ui")
81 .AppendASCII("create_extension_detail_value_expected_output") 83 .AppendASCII("create_extension_detail_value_expected_output")
82 .AppendASCII("good-extension1.json"); 84 .AppendASCII("good-extension1.json");
83 85
84 EXPECT_TRUE(CompareExpectedAndActualOutput(extension_path, pages, 86 EXPECT_TRUE(CompareExpectedAndActualOutput(extension_path, pages,
85 expected_output_path)) << extension_path.value(); 87 expected_output_path)) << extension_path.value();
86 88
87 // Test Extension2 89 // Test Extension2
88 extension_path = data_test_dir_path.AppendASCII("extensions") 90 extension_path = data_test_dir_path.AppendASCII("extensions")
89 .AppendASCII("good") 91 .AppendASCII("good")
90 .AppendASCII("extension2") 92 .AppendASCII("hpiknbiabeeppbpihjehijgoemciehgk")
91 .AppendASCII("2"); 93 .AppendASCII("2");
92 94
93 expected_output_path = data_test_dir_path.AppendASCII("extensions") 95 expected_output_path = data_test_dir_path.AppendASCII("extensions")
94 .AppendASCII("ui") 96 .AppendASCII("ui")
95 .AppendASCII("create_extension_detail_value_expected_output") 97 .AppendASCII("create_extension_detail_value_expected_output")
96 .AppendASCII("good-extension2.json"); 98 .AppendASCII("good-extension2.json");
97 99
98 // It's OK to have duplicate URLs, so long as the IDs are different. 100 // It's OK to have duplicate URLs, so long as the IDs are different.
99 pages[1].url = pages[0].url; 101 pages[1].url = pages[0].url;
100 102
101 EXPECT_TRUE(CompareExpectedAndActualOutput(extension_path, pages, 103 EXPECT_TRUE(CompareExpectedAndActualOutput(extension_path, pages,
102 expected_output_path)) << extension_path.value(); 104 expected_output_path)) << extension_path.value();
103 105
104 // Test Extension3 106 // Test Extension3
105 extension_path = data_test_dir_path.AppendASCII("extensions") 107 extension_path = data_test_dir_path.AppendASCII("extensions")
106 .AppendASCII("good") 108 .AppendASCII("good")
107 .AppendASCII("extension3") 109 .AppendASCII("bjafgdebaacbbbecmhlhpofkepfkgcpa")
108 .AppendASCII("1.0"); 110 .AppendASCII("1.0");
109 111
110 expected_output_path = data_test_dir_path.AppendASCII("extensions") 112 expected_output_path = data_test_dir_path.AppendASCII("extensions")
111 .AppendASCII("ui") 113 .AppendASCII("ui")
112 .AppendASCII("create_extension_detail_value_expected_output") 114 .AppendASCII("create_extension_detail_value_expected_output")
113 .AppendASCII("good-extension3.json"); 115 .AppendASCII("good-extension3.json");
114 116
115 pages.clear(); 117 pages.clear();
116 118
117 EXPECT_TRUE(CompareExpectedAndActualOutput(extension_path, pages, 119 EXPECT_TRUE(CompareExpectedAndActualOutput(extension_path, pages,
118 expected_output_path)) << extension_path.value(); 120 expected_output_path)) << extension_path.value();
119 } 121 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698