xref: /aoo42x/main/slideshow/test/views.cxx (revision d9ee14b8)
170f497fbSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
370f497fbSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
470f497fbSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
570f497fbSAndrew Rist  * distributed with this work for additional information
670f497fbSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
770f497fbSAndrew Rist  * to you under the Apache License, Version 2.0 (the
870f497fbSAndrew Rist  * "License"); you may not use this file except in compliance
970f497fbSAndrew Rist  * with the License.  You may obtain a copy of the License at
1070f497fbSAndrew Rist  *
1170f497fbSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
1270f497fbSAndrew Rist  *
1370f497fbSAndrew Rist  * Unless required by applicable law or agreed to in writing,
1470f497fbSAndrew Rist  * software distributed under the License is distributed on an
1570f497fbSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
1670f497fbSAndrew Rist  * KIND, either express or implied.  See the License for the
1770f497fbSAndrew Rist  * specific language governing permissions and limitations
1870f497fbSAndrew Rist  * under the License.
1970f497fbSAndrew Rist  *
2070f497fbSAndrew Rist  *************************************************************/
2170f497fbSAndrew Rist 
2270f497fbSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #include <cppuhelper/compbase1.hxx>
25cdf0e10cSrcweir #include <comphelper/broadcasthelper.hxx>
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <basegfx/matrix/b2dhommatrix.hxx>
28cdf0e10cSrcweir #include <basegfx/range/b2drectangle.hxx>
29cdf0e10cSrcweir #include <cppcanvas/spritecanvas.hxx>
30cdf0e10cSrcweir 
31cdf0e10cSrcweir #include "view.hxx"
32cdf0e10cSrcweir #include "unoview.hxx"
33cdf0e10cSrcweir #include "unoviewcontainer.hxx"
34cdf0e10cSrcweir #include "shape.hxx"
35cdf0e10cSrcweir #include "tests.hxx"
36*d9ee14b8SDamjan Jovanovic #include "gtest/gtest.h"
37cdf0e10cSrcweir #include "com/sun/star/presentation/XSlideShowView.hpp"
38cdf0e10cSrcweir 
39cdf0e10cSrcweir namespace target = slideshow::internal;
40cdf0e10cSrcweir using namespace ::com::sun::star;
41cdf0e10cSrcweir 
42cdf0e10cSrcweir namespace
43cdf0e10cSrcweir {
44cdf0e10cSrcweir 
45*d9ee14b8SDamjan Jovanovic class UnoViewContainerTest : public ::testing::Test
46cdf0e10cSrcweir {
47cdf0e10cSrcweir public:
48cdf0e10cSrcweir }; // class UnoViewContainerTest
49cdf0e10cSrcweir 
50*d9ee14b8SDamjan Jovanovic TEST_F(UnoViewContainerTest, testContainer)
51*d9ee14b8SDamjan Jovanovic {
52*d9ee14b8SDamjan Jovanovic     target::UnoViewContainer aContainer;
53cdf0e10cSrcweir 
54*d9ee14b8SDamjan Jovanovic     TestViewSharedPtr pView = createTestView();
55*d9ee14b8SDamjan Jovanovic     aContainer.addView( pView );
56cdf0e10cSrcweir 
57*d9ee14b8SDamjan Jovanovic     ASSERT_TRUE( 1 == std::distance( aContainer.begin(), aContainer.end() )) << "Testing container size";
58*d9ee14b8SDamjan Jovanovic     ASSERT_TRUE( pView->paintScreen() ) << "Testing disposedness";
59*d9ee14b8SDamjan Jovanovic     aContainer.dispose();
60*d9ee14b8SDamjan Jovanovic     ASSERT_TRUE( 0 == std::distance( aContainer.begin(), aContainer.end() )) << "Testing dispose: container must be empty";
61*d9ee14b8SDamjan Jovanovic     ASSERT_TRUE( !pView->paintScreen() ) << "Testing dispose: all elements must receive dispose";
62*d9ee14b8SDamjan Jovanovic }
63cdf0e10cSrcweir 
64cdf0e10cSrcweir 
65*d9ee14b8SDamjan Jovanovic } // namespace
66