| OLD | NEW |
| (Empty) |
| 1 // Copyright 2010 Google Inc. | |
| 2 // | |
| 3 // Licensed under the Apache License, Version 2.0 (the "License"); | |
| 4 // you may not use this file except in compliance with the License. | |
| 5 // You may obtain a copy of the License at | |
| 6 // | |
| 7 // http://www.apache.org/licenses/LICENSE-2.0 | |
| 8 // | |
| 9 // Unless required by applicable law or agreed to in writing, software | |
| 10 // distributed under the License is distributed on an "AS IS" BASIS, | |
| 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 12 // See the License for the specific language governing permissions and | |
| 13 // limitations under the License. | |
| 14 // ======================================================================== | |
| 15 // | |
| 16 // Tests the constants that vary depending on the customization of Omaha. | |
| 17 // The test checks for the Google Update variations, but can be modified for | |
| 18 // your purposes. | |
| 19 | |
| 20 #include <windows.h> | |
| 21 #include <tchar.h> | |
| 22 #include <atlbase.h> | |
| 23 #include <oleauto.h> | |
| 24 #include "omaha/base/utils.h" | |
| 25 #include "plugins/update/activex/update_control_idl.h" | |
| 26 #include "omaha/testing/omaha_customization_test.h" | |
| 27 | |
| 28 // Most of the tests are intentionally not using the omaha namespace. Most of | |
| 29 // the values being tested are not in this namespace, and being in the global | |
| 30 // namespace is required by TEST_GU_INT_F to catch conflicts with Google types | |
| 31 // when building non-Google versions. | |
| 32 | |
| 33 class OmahaCustomizationUpdateComInterfaceTest | |
| 34 : public OmahaCustomizationTypeLibComInterfaceTest { | |
| 35 protected: | |
| 36 OmahaCustomizationUpdateComInterfaceTest() | |
| 37 : OmahaCustomizationTypeLibComInterfaceTest(UPDATE_PLUGIN_FILENAME) { | |
| 38 } | |
| 39 }; | |
| 40 | |
| 41 TEST_F(OmahaCustomizationUpdateComInterfaceTest, TypeLib) { | |
| 42 EXPECT_GU_ID_EQ(_T("{b627c883-e979-4873-80b3-ddd0b658b56a}"), | |
| 43 LIBID_GoogleUpdateControlLib); | |
| 44 | |
| 45 EXPECT_SUCCEEDED(GetDocumentation(-1)); | |
| 46 EXPECT_STREQ(_T("GoogleUpdateControlLib"), item_name_); | |
| 47 EXPECT_GU_STREQ(_T("Google Update Browser Plugins 3.0 Type Library"), | |
| 48 item_doc_string_); | |
| 49 EXPECT_EQ(0, help_context_); | |
| 50 EXPECT_TRUE(!help_file_); | |
| 51 } | |
| 52 | |
| 53 TEST_GU_INT_F(OmahaCustomizationUpdateComInterfaceTest, | |
| 54 IGoogleUpdateOneClick) { | |
| 55 // TODO(omaha): Test uuid constants after extracting from IDLs. | |
| 56 EXPECT_GU_ID_EQ(_T("{6F65D62B-2F32-4483-9028-176C30B2389D}"), | |
| 57 __uuidof(IGoogleUpdateOneClick)); | |
| 58 | |
| 59 EXPECT_SUCCEEDED(GetDocumentation(0)); | |
| 60 EXPECT_STREQ(_T("IGoogleUpdateOneClick"), item_name_); | |
| 61 EXPECT_STREQ(_T("Google Update OneClick Control"), item_doc_string_); | |
| 62 EXPECT_EQ(0, help_context_); | |
| 63 EXPECT_TRUE(!help_file_); | |
| 64 } | |
| 65 | |
| 66 TEST_GU_INT_F(OmahaCustomizationUpdateComInterfaceTest, | |
| 67 IGoogleUpdate3WebControl) { | |
| 68 // TODO(omaha): Test uuid constants after extracting from IDLs. | |
| 69 EXPECT_GU_ID_EQ(_T("{57E37502-65A5-484a-A035-C1608B2626EA}"), | |
| 70 __uuidof(IGoogleUpdate3WebControl)); | |
| 71 | |
| 72 EXPECT_SUCCEEDED(GetDocumentation(1)); | |
| 73 EXPECT_STREQ(_T("IGoogleUpdate3WebControl"), item_name_); | |
| 74 EXPECT_STREQ(_T("GoogleUpdate3Web Control"), item_doc_string_); | |
| 75 EXPECT_EQ(0, help_context_); | |
| 76 EXPECT_TRUE(!help_file_); | |
| 77 } | |
| 78 | |
| 79 TEST_GU_INT_F(OmahaCustomizationUpdateComInterfaceTest, | |
| 80 GoogleUpdateOneClickControlCoClass) { | |
| 81 EXPECT_GU_ID_EQ(_T("{c442ac41-9200-4770-8cc0-7cdb4f245c55}"), | |
| 82 __uuidof(GoogleUpdateOneClickControlCoClass)); | |
| 83 | |
| 84 EXPECT_SUCCEEDED(GetDocumentation(2)); | |
| 85 EXPECT_STREQ(_T("GoogleUpdateOneClickControlCoClass"), item_name_); | |
| 86 EXPECT_STREQ(_T("Google Update OneClick Control Class"), item_doc_string_); | |
| 87 EXPECT_EQ(0, help_context_); | |
| 88 EXPECT_TRUE(!help_file_); | |
| 89 } | |
| 90 | |
| 91 TEST_GU_INT_F(OmahaCustomizationUpdateComInterfaceTest, | |
| 92 GoogleUpdate3WebControlCoClass) { | |
| 93 EXPECT_GU_ID_EQ(_T("{c3101a8b-0ee1-4612-bfe9-41ffc1a3c19d}"), | |
| 94 __uuidof(GoogleUpdate3WebControlCoClass)); | |
| 95 | |
| 96 EXPECT_SUCCEEDED(GetDocumentation(3)); | |
| 97 EXPECT_STREQ(_T("GoogleUpdate3WebControlCoClass"), item_name_); | |
| 98 EXPECT_STREQ(_T("GoogleUpdate3Web Control Class"), item_doc_string_); | |
| 99 EXPECT_EQ(0, help_context_); | |
| 100 EXPECT_TRUE(!help_file_); | |
| 101 } | |
| 102 | |
| 103 // Verifies there are no new interfaces in the TypeLib. | |
| 104 TEST_F(OmahaCustomizationUpdateComInterfaceTest, VerifyNoNewInterfaces) { | |
| 105 EXPECT_EQ(TYPE_E_ELEMENTNOTFOUND, GetDocumentation(4)) | |
| 106 << _T("A new interface may have been added. If so, roll ") | |
| 107 << _T("the plugin version and add test(s) for new interface(s)."); | |
| 108 } | |
| OLD | NEW |