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

Unified Diff: goopdate/app_version_unittest.cc

Issue 624713003: Keep only base/extractor.[cc|h]. (Closed) Base URL: https://chromium.googlesource.com/external/omaha.git@master
Patch Set: Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « goopdate/app_version.cc ('k') | goopdate/application_usage_data.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: goopdate/app_version_unittest.cc
diff --git a/goopdate/app_version_unittest.cc b/goopdate/app_version_unittest.cc
deleted file mode 100644
index e6eff3604d291986598672c0ad4ff1850a0feeca..0000000000000000000000000000000000000000
--- a/goopdate/app_version_unittest.cc
+++ /dev/null
@@ -1,146 +0,0 @@
-// Copyright 2009 Google Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-// ========================================================================
-
-#include <atlbase.h>
-#include <atlcom.h>
-#include "omaha/base/scoped_ptr_address.h"
-#include "omaha/base/synchronized.h"
-#include "omaha/base/utils.h"
-#include "omaha/common/update3_utils.h"
-#include "omaha/goopdate/model.h"
-#include "omaha/testing/unit_test.h"
-
-namespace omaha {
-
-// TODO(omaha): there is a problem with this unit test. The model is built
-// bottom up. This makes it impossible to set the references to parents. Will
-// have to fix the code, eventually using Builder DP to create a bunch of
-// models containing bundles, apps, and such.
-
-#if 0
-
-const TCHAR* const kTestId = _T("{8260D23D-D23B-427F-AF1A-2CE36E6F073B}");
-
-class IDummyUnknownImpl : public IUnknown {
- public:
- virtual ULONG STDMETHODCALLTYPE AddRef() {
- return 1;
- }
- virtual ULONG STDMETHODCALLTYPE Release() {
- return 1;
- }
- virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID, void**) {
- return E_NOTIMPL;
- }
-};
-
-class AppVersionTest : public testing::Test {
- protected:
- LLock lock_;
-};
-
-TEST_F(AppVersionTest, TestReadOnly) {
- IDummyUnknownImpl dummy_unknown;
- scoped_ptr<AppVersion> app_version;
- EXPECT_SUCCEEDED(AppVersion::Create(&lock_,
- &dummy_unknown,
- true,
- address(app_version)));
-
- CComPtr<IAppDataReadOnly> version_data_ro;
- EXPECT_SUCCEEDED(update3_utils::GetAppData(app_version.get(),
- &version_data_ro));
-
- CComPtr<IAppData> version_data_rw;
- EXPECT_EQ(E_NOINTERFACE,
- update3_utils::GetAppData(app_version.get(), &version_data_rw));
-
- // Get the IDispatch interface, and verify that it is a read-only interface.
- CComPtr<IDispatch> version_data_ro_dispatch;
- EXPECT_SUCCEEDED(
- version_data_ro.QueryInterface(&version_data_ro_dispatch));
-
- CComVariant var;
- EXPECT_SUCCEEDED(version_data_ro_dispatch.GetPropertyByName(_T("appGuid"),
- &var));
- EXPECT_EQ(VT_BSTR, V_VT(&var));
- EXPECT_STREQ(GuidToString(GUID_NULL), V_BSTR(&var));
-
- var = kTestId;
-
- // ITypeInfo::Invoke with a DISPATCH_PROPERTYPUT results in a
- // DISP_E_BADPARAMCOUNT, and not in a DISP_E_MEMBERNOTFOUND, as I would have
- // expected.
- EXPECT_EQ(DISP_E_BADPARAMCOUNT,
- version_data_ro_dispatch.PutPropertyByName(_T("appGuid"), &var));
-}
-
-TEST_F(AppVersionTest, TestReadWrite) {
- IDummyUnknownImpl dummy_unknown;
- scoped_ptr<AppVersion> app_version;
- EXPECT_SUCCEEDED(AppVersion::Create(&lock_,
- &dummy_unknown,
- false,
- address(app_version)));
-
- CComPtr<IAppDataReadOnly> version_data_ro;
- EXPECT_SUCCEEDED(update3_utils::GetAppData(app_version.get(),
- &version_data_ro));
-
- CComPtr<IAppData> version_data_rw;
- EXPECT_SUCCEEDED(update3_utils::GetAppData(app_version.get(),
- &version_data_rw));
-
- CComPtr<IUnknown> version_data_ro_unknown;
- EXPECT_SUCCEEDED(
- version_data_ro.QueryInterface(&version_data_ro_unknown));
-
- CComPtr<IUnknown> version_data_rw_unknown;
- EXPECT_SUCCEEDED(
- version_data_rw.QueryInterface(&version_data_rw_unknown));
-
- // COM identity rule.
- EXPECT_TRUE(version_data_ro_unknown == version_data_rw_unknown);
-
- // Get the IDispatch interface, and verify that it is a read-write interface.
- CComPtr<IDispatch> version_data_rw_dispatch;
- EXPECT_SUCCEEDED(
- version_data_rw.QueryInterface(&version_data_rw_dispatch));
-
- CComVariant var;
- EXPECT_SUCCEEDED(version_data_rw_dispatch.GetPropertyByName(_T("appGuid"),
- &var));
- EXPECT_EQ(VT_BSTR, V_VT(&var));
- EXPECT_STREQ(GuidToString(GUID_NULL), V_BSTR(&var));
-
- var = kTestId;
- EXPECT_SUCCEEDED(version_data_rw_dispatch.PutPropertyByName(_T("appGuid"),
- &var));
-
- var.ClearToZero();
- EXPECT_SUCCEEDED(version_data_rw_dispatch.GetPropertyByName(_T("appGuid"),
- &var));
- EXPECT_EQ(VT_BSTR, V_VT(&var));
- EXPECT_STREQ(kTestId, V_BSTR(&var));
-
- // Verify that the read-only interface returns the same value for the appGuid.
- CComBSTR app_id;
- EXPECT_SUCCEEDED(version_data_ro->get_appId(&app_id));
- EXPECT_STREQ(kTestId, app_id);
-}
-
-#endif
-
-} // namespace omaha
« no previous file with comments | « goopdate/app_version.cc ('k') | goopdate/application_usage_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698